Skip to content

Commit

Permalink
Fixed line numbers when a preprocessor directive fails.
Browse files Browse the repository at this point in the history
  • Loading branch information
icculus committed Feb 15, 2009
1 parent 92498d7 commit daec620
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions mojoshader_preprocessor.c
Expand Up @@ -553,12 +553,12 @@ int preprocessor_outofmemory(Preprocessor *_ctx)
static int require_newline(IncludeState *state)
{
const char *source = state->source;
const unsigned int linenum = state->line;
const Token token = preprocessor_internal_lexer(state);
state->source = source; // rewind no matter what.
state->line = linenum;
if (token == TOKEN_INCOMPLETE_COMMENT)
{
state->source = source; // pick this up later.
return 1; // call it an eol.
} // if
return 1; // call it an eol.
return ( (token == ((Token) '\n')) || (token == TOKEN_EOI) );
} // require_newline

Expand Down

0 comments on commit daec620

Please sign in to comment.