chiark
/
gitweb
/
~mdw
/
distorted-keys
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
f0c3e6f
)
keyfunc.sh: Protect arguments to expr(1).
author
Mark Wooding
<mdw@distorted.org.uk>
Sat, 7 Jan 2012 02:08:18 +0000
(
02:08
+0000)
committer
Mark Wooding
<mdw@distorted.org.uk>
Sat, 7 Jan 2012 16:12:41 +0000
(16:12 +0000)
Make sure they don't look like operators or functions.
keyfunc.sh.in
patch
|
blob
|
blame
|
history
diff --git
a/keyfunc.sh.in
b/keyfunc.sh.in
index 38ca243fe7ff31a6e7de1d920e27f8aa2a217876..2a10f267a46fdc3d69d434b181543fd7f6fbdd8b 100644
(file)
--- a/
keyfunc.sh.in
+++ b/
keyfunc.sh.in
@@
-144,7
+144,7
@@
check () {
validp=t
case "$thing" in
*"$nl"*) validp=nil ;;
- *) if ! expr >/dev/null "
$thing" : "
$ckpat\$"; then validp=nil; fi ;;
+ *) if ! expr >/dev/null "
Q$thing" : "Q
$ckpat\$"; then validp=nil; fi ;;
esac
case $validp in
nil) echo >&2 "$quis: bad $ckwhat \`$thing'"; exit 1 ;;