Fixed ${#} which was incorrectly parsed as ${#var}
authorChristos Zoulas <christos@ucbvax.Berkeley.EDU>
Wed, 17 May 1995 10:58:37 +0000 (02:58 -0800)
committerChristos Zoulas <christos@ucbvax.Berkeley.EDU>
Wed, 17 May 1995 10:58:37 +0000 (02:58 -0800)
SCCS-vsn: bin/sh/parser.c 8.7

usr/src/bin/sh/parser.c

index 4ffe3bf..f6f8a36 100644 (file)
@@ -9,7 +9,7 @@
  */
 
 #ifndef lint
  */
 
 #ifndef lint
-static char sccsid[] = "@(#)parser.c   8.6 (Berkeley) %G%";
+static char sccsid[] = "@(#)parser.c   8.7 (Berkeley) %G%";
 #endif /* not lint */
 
 #include <stdlib.h>
 #endif /* not lint */
 
 #include <stdlib.h>
@@ -1126,8 +1126,10 @@ parsesub: {
                if (c == '{') {
                        c = pgetc();
                        if (c == '#') {
                if (c == '{') {
                        c = pgetc();
                        if (c == '#') {
-                               subtype = VSLENGTH;
-                               c = pgetc();
+                               if ((c = pgetc()) == '}')
+                                       c = '#';
+                               else
+                                       subtype = VSLENGTH;
                        }
                        else
                                subtype = 0;
                        }
                        else
                                subtype = 0;