From: Christos Zoulas Date: Wed, 17 May 1995 10:58:37 +0000 (-0800) Subject: Fixed ${#} which was incorrectly parsed as ${#var} X-Git-Url: https://git.subgeniuskitty.com/unix-history/.git/commitdiff_plain/fb658e8cb01c0c68ccafd85e7919e02d22833447?hp=6f21cb3393b1683d93de674d9596b3bcb801a1c7 Fixed ${#} which was incorrectly parsed as ${#var} SCCS-vsn: bin/sh/parser.c 8.7 --- diff --git a/usr/src/bin/sh/parser.c b/usr/src/bin/sh/parser.c index 4ffe3bf23a..f6f8a362f4 100644 --- a/usr/src/bin/sh/parser.c +++ b/usr/src/bin/sh/parser.c @@ -9,7 +9,7 @@ */ #ifndef lint -static char sccsid[] = "@(#)parser.c 8.6 (Berkeley) %G%"; +static char sccsid[] = "@(#)parser.c 8.7 (Berkeley) %G%"; #endif /* not lint */ #include @@ -1126,8 +1126,10 @@ parsesub: { if (c == '{') { c = pgetc(); if (c == '#') { - subtype = VSLENGTH; - c = pgetc(); + if ((c = pgetc()) == '}') + c = '#'; + else + subtype = VSLENGTH; } else subtype = 0;