File tree Expand file tree Collapse file tree 1 file changed +4
-8
lines changed Expand file tree Collapse file tree 1 file changed +4
-8
lines changed Original file line number Diff line number Diff line change @@ -492,14 +492,10 @@ function strip_ansi_color_codes( input )
492492    }
493493
494494
495-     #  I'm using match() to get the location of the indicator character because if I were to use
496-     #  gensub() I'd have to strip the diff line of ansi color codes either before or after since it
497-     #  can embed the color codes in a match. I think it would be slower to strip every diff line if
498-     #  done before, or if done after it could lead to corruption if internally gensub() prepends or
499-     #  appends escape codes to the indicator that it finds in the diff line itself (ie actually part
500-     #  of the diff line, not the colorization added by git diff). Unfortunately early versions of
501-     #  gawk (like the one included with git for Windows) do not support an array parameter for
502-     #  match() so the indicator must be extracted on success by using substr().
495+     #  Extract the indicator. Unfortunately early versions of gawk (like the one included with git
496+     #  for Windows) do not support an array parameter for match() so the indicator must be extracted
497+     #  on success by using substr().
498+ 
503499    if( ( $0  ! ~ /^(\0 33\[ [0-9; ]* m)* [\\  +-]/ ) ||  ! match( $0 , /[\\  +-]/ ) ||  ( RLENGTH ! = 1 ) )
504500    {
505501        errmsg = " Failed to extract indicator from diff line." ; 
    
 
   
 
     
   
   
          
     
  
    
     
 
    
      
     
 
     
    You can’t perform that action at this time.
  
 
    
  
     
    
      
        
     
 
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments