about summary refs log tree commit diff
diff options
context:
space:
mode:
authorAndrew Main <zefram@users.sourceforge.net>2000-04-06 17:21:52 +0000
committerAndrew Main <zefram@users.sourceforge.net>2000-04-06 17:21:52 +0000
commit181811bf80eaa7c11e3d465c33ce5c9ed4e0415d (patch)
tree4056282129990f2af12ee97399f61a25c41c7c1c
parent84e12c1caa116e69f9c0f9d88a3034da23882eda (diff)
downloadzsh-181811bf80eaa7c11e3d465c33ce5c9ed4e0415d.tar.gz
zsh-181811bf80eaa7c11e3d465c33ce5c9ed4e0415d.tar.xz
zsh-181811bf80eaa7c11e3d465c33ce5c9ed4e0415d.zip
zefram2: Src/lex.c: Support "3&> foo" etc.
-rw-r--r--ChangeLog4
-rw-r--r--Src/lex.c15
2 files changed, 17 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 6ec933d9c..58ed4c8df 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,9 @@
 2000-04-06  Andrew Main  <zefram@zsh.org>
 
+	* zefram2: Src/lex.c: Support "3&> foo" etc.
+
+2000-04-06  Andrew Main  <zefram@zsh.org>
+
 	* zefram1: configure.in, Etc/zsh-development-guide: List of tools
 	required for development work, and a little more conspicuous
 	explanation of the config.status hack.
diff --git a/Src/lex.c b/Src/lex.c
index 2c19c097e..ccd04b2d9 100644
--- a/Src/lex.c
+++ b/Src/lex.c
@@ -642,7 +642,18 @@ gettok(void)
 	return DOUTPAR;
     } else if (idigit(c)) {	/* handle 1< foo */
 	d = hgetc();
-	if (d == '>' || d == '<') {
+	if(d == '&') {
+	    d = hgetc();
+	    if(d == '>') {
+		peekfd = c - '0';
+		hungetc('>');
+		c = '&';
+	    } else {
+		hungetc(d);
+		lexstop = 0;
+		hungetc('&');
+	    }
+	} else if (d == '>' || d == '<') {
 	    peekfd = c - '0';
 	    c = d;
 	} else {
@@ -702,6 +713,7 @@ gettok(void)
 	else if (d == '!' || d == '|')
 	    return AMPERBANG;
 	else if (d == '>') {
+	    tokfd = peekfd;
 	    d = hgetc();
 	    if (d == '!' || d == '|')
 		return OUTANGAMPBANG;
@@ -715,7 +727,6 @@ gettok(void)
 	    }
 	    hungetc(d);
 	    lexstop = 0;
-	    tokfd = -1;
 	    return AMPOUTANG;
 	}
 	hungetc(d);