diff options
| author | ricknu-0@student.ltu.se <ricknu-0@student.ltu.se> | 2007-07-19 02:01:28 +0200 |
|---|---|---|
| committer | Josh Triplett <josh@freedesktop.org> | 2007-07-29 01:11:59 -0700 |
| commit | cd4288f195f11f6c0a78bca03db009a0494da7cc (patch) | |
| tree | 446645b583b627e9b2cf487a5d2fdf6bf9a28093 /tokenize.c | |
| parent | 3679526ce5f88fdc1c870df3838733148af4c1ae (diff) | |
| download | sparse-dev-cd4288f195f11f6c0a78bca03db009a0494da7cc.tar.gz | |
tokenize.c: Simplify drop_stream_eoln().
Simplifying function drop_stream_eoln().
Signed-off-by: Richard Knutsson <ricknu-0@student.ltu.se>
Diffstat (limited to 'tokenize.c')
| -rw-r--r-- | tokenize.c | 13 |
1 files changed, 6 insertions, 7 deletions
@@ -578,15 +578,14 @@ static int get_string_token(int next, stream_t *stream) static int drop_stream_eoln(stream_t *stream) { - int next = nextchar(stream); drop_token(stream); for (;;) { - int curr = next; - if (curr == EOF) - return next; - next = nextchar(stream); - if (curr == '\n') - return next; + switch (nextchar(stream)) { + case EOF: + return EOF; + case '\n': + return nextchar(stream); + } } } |
