summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--src/parser.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/parser.c b/src/parser.c
index 6a8a4a4..efa8060 100644
--- a/src/parser.c
+++ b/src/parser.c
@@ -1262,7 +1262,7 @@ varname:
 				STPUTC(c, out);
 				c = pgetc_eatbnl();
 			} while (is_digit(c));
-		} else {
+		} else if (c != '}') {
 			int cc = c;
 
 			c = pgetc_eatbnl();
@@ -1290,7 +1290,8 @@ varname:
 			}
 
 			USTPUTC(cc, out);
-		}
+		} else
+			goto badsub;
 
 		if (subtype == 0) {
 			int cc = c;