76b14cee09d2508b08768973073e58ef78b3ff29 — emersion 1 year, 18 days ago f5a30a6
parser: fix io_number

Fixes https://github.com/emersion/mrsh/issues/64
1 files changed, 4 insertions(+), 0 deletions(-)

M parser/program.c
M parser/program.c => parser/program.c +4 -0
@@ 181,6 181,10 @@ static bool io_file(struct mrsh_parser *state,
 }
 
 static int io_number(struct mrsh_parser *state) {
+	if (!symbol(state, TOKEN)) {
+		return -1;
+	}
+
 	char c = parser_peek_char(state);
 	if (!isdigit(c)) {
 		return -1;