protect against a malformed regex deleting your

This commit is contained in:
rupa committed 2009-07-21 15:13:38 -04:00
1 parent 45dd885e7c
commit 151872282f
1 file changed
+6 -2
+6 -2
View File
@@ -124,8 +124,12 @@ z() {
} else if( ncx ) output(nocase, ncx, common(nocase, a, 1))
}
' $datafile)"
mv -f $datafile.tmp $datafile
[ "$cd" ] && cd "$cd"
if [ $? -gt 0 ]; then
rm -f $datafile.tmp
else
mv -f $datafile.tmp $datafile
[ "$cd" ] && cd "$cd"
fi
fi
}
# tab completion