From 30233f66c7692807ea5b86d0155fd13dd31d9b94 Mon Sep 17 00:00:00 2001 From: "Ryan C. Gordon" Date: Mon, 16 Feb 2009 20:29:28 -0500 Subject: [PATCH] Fix state when rewinding stream. --- mojoshader_preprocessor.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/mojoshader_preprocessor.c b/mojoshader_preprocessor.c index 25015b07..1360735d 100644 --- a/mojoshader_preprocessor.c +++ b/mojoshader_preprocessor.c @@ -571,9 +571,11 @@ int preprocessor_outofmemory(Preprocessor *_ctx) static int require_newline(IncludeState *state) { const char *source = state->source; + const unsigned int bytes_left = state->bytes_left; const unsigned int linenum = state->line; const Token token = preprocessor_internal_lexer(state); state->source = source; // rewind no matter what. + state->bytes_left = bytes_left; state->line = linenum; if (token == TOKEN_INCOMPLETE_COMMENT) return 1; // call it an eol.