summaryrefslogtreecommitdiff
path: root/gnu
diff options
context:
space:
mode:
authorTodd C. Miller <millert@cvs.openbsd.org>2001-09-27 23:51:06 +0000
committerTodd C. Miller <millert@cvs.openbsd.org>2001-09-27 23:51:06 +0000
commitf142f39d9c66ef6c721eeed1c0636f7e35c3b24c (patch)
treef25d74f1cfdbc6d66d6d55a89764566e1748bb3e /gnu
parentfc9661ba7747f3154acf277c4c0ea475839171e7 (diff)
Use POSIX :space: character class as suggested by solar@openwall.com
Also add a sepatate case for --suffix= to keep the regex exact
Diffstat (limited to 'gnu')
-rw-r--r--gnu/usr.bin/gzip/znew6
1 files changed, 4 insertions, 2 deletions
diff --git a/gnu/usr.bin/gzip/znew b/gnu/usr.bin/gzip/znew
index c580e09f015..b531473b692 100644
--- a/gnu/usr.bin/gzip/znew
+++ b/gnu/usr.bin/gzip/znew
@@ -12,9 +12,11 @@ block=1024
# block is the disk block size (best guess, need not be exact)
case "$GZIP" in
- *-S*) ext=`echo "$GZIP" | sed 's/^.*-S[ ]*\([^ ]*\).*$/\1/'`
+ *-S*) ext=`echo "$GZIP" | sed 's/^.*-S[[:space:]]*\([^[:space:]]*\).*$/\1/'`
;;
- *-suffix*) ext=`echo "$GZIP" | sed 's/^.*--suffix[ =]*\([^ ]*\).*$/\1/'`
+ *-suffix=*) ext=`echo "$GZIP" | sed 's/^.*--suffix=\([^[:space:]]*\).*$/\1/'`
+ ;;
+ *-suffix*) ext=`echo "$GZIP" | sed 's/^.*--suffix[[:space:]][[:space:]]*\([^[:space:]]*\).*$/\1/'`
;;
*) ext='.gz'
;;