summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTodd C. Miller <millert@cvs.openbsd.org>1999-01-20 06:38:53 +0000
committerTodd C. Miller <millert@cvs.openbsd.org>1999-01-20 06:38:53 +0000
commit80ac73225a753264dc39c2ba66794f5bf1bf9a0f (patch)
treefd7cbd5b2dd58abc442d18a5d7e51201031ac6d4
parentd9c77a47a8943b4d56cc22c6abe57334f72ab093 (diff)
Need to do toupper() on the first char of millert when we replace '&' in gecos
-rw-r--r--gnu/usr.bin/sendbug/sendbug.sh14
1 files changed, 11 insertions, 3 deletions
diff --git a/gnu/usr.bin/sendbug/sendbug.sh b/gnu/usr.bin/sendbug/sendbug.sh
index 5a33d3c1f35..3e2ecab2c6c 100644
--- a/gnu/usr.bin/sendbug/sendbug.sh
+++ b/gnu/usr.bin/sendbug/sendbug.sh
@@ -21,7 +21,7 @@
# along with GNU GNATS; see the file COPYING. If not, write to
# the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
#
-# $OpenBSD: sendbug.sh,v 1.8 1999/01/20 06:10:59 millert Exp $
+# $OpenBSD: sendbug.sh,v 1.9 1999/01/20 06:38:52 millert Exp $
# The version of this send-pr.
VERSION=3.97
@@ -71,15 +71,23 @@ fi
umask 077
+# For '&' expansion in gecos
+TEMP=${LOGNAME}
+while test ${#TEMP} -gt 1; do
+ TEMP=${TEMP%?}
+done
+typeset -u FIRSTCHAR=${TEMP}
+EXPANSION="${FIRSTCHAR}${LOGNAME#?}"
+
# How to read the passwd database.
if [ -f /bin/domainname ]; then
if [ "`/bin/domainname`" != "" -a -f /usr/bin/ypcat ]; then
PASSWD="/usr/bin/ypcat passwd 2>/dev/null | cat - /etc/passwd | grep '^$LOGNAME:' |
- cut -f5 -d':' | sed -e 's/,.*//' -e 's/\&/$LOGNAME/g'"
+ cut -f5 -d':' | sed -e 's/,.*//' -e 's/\&/$EXPANSION/g'"
fi
fi
if [ "$PASSWD" = "" ]; then
- PASSWD="cat /etc/passwd | grep '^$LOGNAME:' | cut -f5 -d':' | sed -e 's/,.*//' -e 's/\&/$LOGNAME/g'"
+ PASSWD="cat /etc/passwd | grep '^$LOGNAME:' | cut -f5 -d':' | sed -e 's/,.*//' -e 's/\&/$EXPANSION/g'"
fi
if [ "`echo -n foo`" = foo ]; then