From 290bef4e05c12ff568ff49dc07920d3677c0d4f9 Mon Sep 17 00:00:00 2001 From: Bruce Momjian Date: Mon, 2 Jun 1997 13:55:19 +0000 Subject: [PATCH] Allow for EOF or \0 as input() return from lex. --- src/lextest/scan.l | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/lextest/scan.l b/src/lextest/scan.l index 6f801376a3..5a20a5fa5f 100644 --- a/src/lextest/scan.l +++ b/src/lextest/scan.l @@ -1,10 +1,11 @@ /* This should work, but non-patched flex 2.5.3 fails because input() - doesn't return EOF + doesn't return EOF or '\0' Bruce Momjian */ %% . { - while (input() != EOF) + int ch; + while ((ch = input()) != EOF && ch != '\0') ; } -- 2.11.0