about summary refs log tree commit diff
path: root/Src/lex.c
diff options
context:
space:
mode:
authorJun-ichi Takimoto <takimoto-j@kba.biglobe.ne.jp>2014-12-10 08:20:40 +0900
committerJun-ichi Takimoto <takimoto-j@kba.biglobe.ne.jp>2014-12-10 08:20:40 +0900
commit45d0046d8ff22e6a239f2c8c2e12ab5e60425e33 (patch)
tree4bae23f50596ce7762daa2d3543b69dd4b3210f6 /Src/lex.c
parent0a07ffd47cb5000ff32d5fc5905e7d3e87603d16 (diff)
downloadzsh-45d0046d8ff22e6a239f2c8c2e12ab5e60425e33.tar.gz
zsh-45d0046d8ff22e6a239f2c8c2e12ab5e60425e33.tar.xz
zsh-45d0046d8ff22e6a239f2c8c2e12ab5e60425e33.zip
33940: handle backslash-meta correctly in lexer
Diffstat (limited to 'Src/lex.c')
-rw-r--r--Src/lex.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/Src/lex.c b/Src/lex.c
index 1a854f52b..b2a05448c 100644
--- a/Src/lex.c
+++ b/Src/lex.c
@@ -1326,8 +1326,20 @@ gettokstr(int c, int sub)
 		c = hgetc();
 		if (!lexstop)
 		    continue;
-	    } else
+	    } else {
 		add(Bnull);
+		if (c == STOUC(Meta)) {
+		    c = hgetc();
+#ifdef DEBUG
+		    if (lexstop) {
+			fputs("BUG: input terminated by Meta\n", stderr);
+			fflush(stderr);
+			goto brk;
+		    }
+#endif
+		    add(Meta);
+		}
+	    }
 	    if (lexstop)
 		goto brk;
 	    break;