Skip to content

Commit

Permalink
fix for gawk with regex chars in paths
Browse files Browse the repository at this point in the history
Sub out regex chars in paths before comparing them. Fixes gawk and
doesn't seem to break other awks. Closes rupa#54
  • Loading branch information
rupa committed Jul 4, 2012
1 parent 8272e6f commit 9162239
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion z.sh
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ _z() {
if( short == "/" ) return
# escape regex chars in right hand side
#gsub(/[\(\[\|]/, "\\\&", short)
gsub(/[\(\[\|]/, "\\&", short)
# shortest match must be common to each match
for( i in matches ) if( matches[i] && i !~ short ) return
Expand Down

0 comments on commit 9162239

Please sign in to comment.