@@ -274,9 +274,9 @@ function fix_extracted_path(input)
274274    return  input; 
275275  }
276276
277-   if(input ! ~ /^\0 42? [ab ]\/ /)
277+   if(input ! ~ /^\0 42? [abiwco ]\/ /)
278278  {
279-     errmsg = " fix_extracted_path(): sanity check failed, expected a/ or b / " 
279+     errmsg = " fix_extracted_path(): sanity check failed, expected [abiwco] / " 
280280             " prefix." 
281281             " \n" " Path: " ; 
282282    FATAL(errmsg); 
@@ -301,15 +301,15 @@ function fix_extracted_path(input)
301301  }
302302
303303  #  Remove an erroneous trailing tab that git diff can add to some non-binary
304-   #  paths. eg an unquoted 'b/a $b	' becomes 'b/a $b' if the diff line only 
305-   #  contains the latter.
304+   #  paths. eg an unquoted 'b/a $b	' becomes 'b/a $b' if the diff line
305+   #  only  contains the latter.
306306  if(( input ~  / \t$/ ) &&  ! index(diff,  input) &&  \
307307     index(diff, substr(input, 1 , length(input) - 1 ))  )
308308  {
309309    sub(/\t $/, " " ; 
310310  }
311311
312-   sub(/[ab ]\/ /, " " ; 
312+   sub(/[abiwco ]\/ /, " " ; 
313313
314314  return  input; 
315315}
@@ -464,7 +464,7 @@ function print_path(a_path)
464464    stripped = strip_ansi_color_codes($0 ); 
465465
466466    #  Check for oldfile path
467-     regex = " ^\\ -\\ -\\ - (\\ 042?a \\ /.+|\\ /dev\\ /null)$" ; 
467+     regex = " ^\\ -\\ -\\ - (\\ 042?[aiwco] \\ /.+|\\ /dev\\ /null)$" ; 
468468    if(stripped ~  regex)
469469    {
470470      oldfile_path = fix_extracted_path(gensub(regex, " \\ 1" ; 
@@ -479,7 +479,7 @@ function print_path(a_path)
479479    }
480480
481481    #  Check for newfile path
482-     regex = " ^\\ +\\ +\\ + (\\ 042?b \\ /.+|\\ /dev\\ /null)$" ; 
482+     regex = " ^\\ +\\ +\\ + (\\ 042?[biwco] \\ /.+|\\ /dev\\ /null)$" ; 
483483    if(stripped ~  regex)
484484    {
485485      path = fix_extracted_path(gensub(regex, " \\ 1" ; 
@@ -509,7 +509,7 @@ function print_path(a_path)
509509      {
510510        oldfile_path = substr(path, 1, length(path) - RLENGTH); 
511511
512-         if(( oldfile_path ~  / ^\042 ? a \// ) &&  index(diff,  oldfile_path)) 
512+         if(( oldfile_path ~  / ^\042 ? [aiwco] \// ) &&  index(diff,  oldfile_path)) 
513513        {
514514          oldfile_path = fix_extracted_path(oldfile_path); 
515515          found_oldfile_path = 1; 
@@ -521,7 +521,7 @@ function print_path(a_path)
521521      #  This gets the path for a binary file by digging through the first line
522522      #  of the diff header ('diff') and the binary file notice line
523523      #  ('stripped') to find the longest rightmost match between the two.
524-       while(! found_path &&  match(path, /and \0 42? b \/ .+$/))
524+       while(! found_path &&  match(path, /and \0 42? [biwco] \/ .+$/))
525525      {
526526        path_len = RLENGTH - 4; 
527527        path = substr(path, RSTART + 4, path_len); 
0 commit comments