From b0c1735026ecb1919c5721cce2aacfd0ffd060fa Mon Sep 17 00:00:00 2001 From: drochner Date: Tue, 27 Jul 1999 15:41:27 +0000 Subject: [PATCH] make sure only whole words are matched, use [:space:] RE to avoid embedded s --- games/wtf/wtf | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/games/wtf/wtf b/games/wtf/wtf index f810817a2df7..c4a0d893c567 100644 --- a/games/wtf/wtf +++ b/games/wtf/wtf @@ -1,6 +1,6 @@ #!/bin/sh # -# $NetBSD: wtf,v 1.3 1999/07/25 20:29:04 briggs Exp $ +# $NetBSD: wtf,v 1.4 1999/07/27 15:41:27 drochner Exp $ # # Public domain # @@ -18,7 +18,8 @@ fi rv=0 while [ $# -gt 0 ] ; do target=`echo $1 | tr '[a-z]' '[A-Z]'` - ans=`sed -ne "/^$target/s/^$target[ ]*//p" < $acronyms 2>/dev/null` + ans=`sed -ne "/^$target[[:space:]]/s/^$target[[:space:]]*//p" \ + < $acronyms 2>/dev/null` if [ "$ans" != "" ] ; then echo "$target: $ans" else