From 391bce7ca24a8def655ce173b92875ba4e365594 Mon Sep 17 00:00:00 2001 From: Love Hornquist Astrand Date: Sun, 2 Oct 2011 13:46:28 +0200 Subject: [PATCH] lets try classic input() too --- lib/hx509/sel-lex.l | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/lib/hx509/sel-lex.l b/lib/hx509/sel-lex.l index 4c9396750..197eec781 100644 --- a/lib/hx509/sel-lex.l +++ b/lib/hx509/sel-lex.l @@ -50,6 +50,7 @@ unsigned lineno = 1; static char * handle_string(void); static int lex_input(char *, int); +static int lex_classic_input(void); struct hx_expr_input _hx509_expr_input; @@ -62,6 +63,9 @@ struct hx_expr_input _hx509_expr_input; #undef YY_INPUT #define YY_INPUT(buf,res,maxsize) (res = lex_input(buf, maxsize)) +#undef input +#define input() lex_classic_input() + #undef ECHO %} @@ -137,3 +141,16 @@ lex_input(char *buf, int max_size) return n; } + +static int +lex_classic_inputinput(void) +{ + int n; + + n = _hx509_expr_input.length - _hx509_expr_input.offset; + if (n <= 0) + return YY_NULL; + + return _hx509_expr_input.buf[_hx509_expr_input.offset++]; +} +