Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fix state when rewinding stream.
  • Loading branch information
icculus committed Feb 17, 2009
1 parent 378e88d commit 30233f6
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions mojoshader_preprocessor.c
Expand Up @@ -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.
Expand Down

0 comments on commit 30233f6

Please sign in to comment.