deal with weird dirs a bit better

* quote tab expansions
* commented out code for thinking about dirs that break awk regex.
  Haven't quite figured out a good approach.
This commit is contained in:
rupa committed 2012-02-07 11:52:47 -05:00
1 parent 4a0f3f8280
commit 7fe57a5829
1 file changed
+5 -1
+5 -1
View File
@@ -92,7 +92,7 @@ _z() {
} else {
for( i in fnd ) $1 !~ fnd[i] && $1 = ""
}
if( $1 ) print $1
if( $1 ) print "\"" $1 "\""
}
' "$datafile" 2>/dev/null
@@ -154,6 +154,10 @@ _z() {
if( matches[i] && (!short || length(i) < length(short)) ) short = i
}
if( short == "/" ) return
# escape regex chars in right hand side
#gsub(/[\(\[\|]/, "\\\&", short)
# shortest match must be common to each match
for( i in matches ) if( matches[i] && i !~ short ) return
return short