From: Sven Verdoolaege Date: Sat, 5 Mar 2011 09:38:18 +0000 (+0100) Subject: isl_stream: only quote newline using '\' X-Git-Tag: isl-0.06~26 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=cf661b2694c66d8644a985886d433715f69c39b4;p=platform%2Fupstream%2Fisl.git isl_stream: only quote newline using '\' This is all we need to support line continuation. Signed-off-by: Sven Verdoolaege --- diff --git a/isl_stream.c b/isl_stream.c index bb0f817..6a7a912 100644 --- a/isl_stream.c +++ b/isl_stream.c @@ -187,6 +187,13 @@ static int stream_getc(struct isl_stream *s) return c; } +static void isl_stream_ungetc(struct isl_stream *s, int c) +{ + isl_assert(s->ctx, s->n_un < 5, return); + s->un[s->n_un++] = c; + s->c = -1; +} + static int isl_stream_getc(struct isl_stream *s) { int c; @@ -194,18 +201,13 @@ static int isl_stream_getc(struct isl_stream *s) do { c = stream_getc(s); if (c != '\\') - break; + return c; c = stream_getc(s); } while (c == '\n'); - return c; -} + isl_stream_ungetc(s, c); -static void isl_stream_ungetc(struct isl_stream *s, int c) -{ - isl_assert(s->ctx, s->n_un < 5, return); - s->un[s->n_un++] = c; - s->c = -1; + return '\\'; } static int isl_stream_push_char(struct isl_stream *s, int c)