aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/tokenize.c
diff options
authorricknu-0@student.ltu.se <ricknu-0@student.ltu.se>2007-07-19 02:01:28 +0200
committerJosh Triplett <josh@freedesktop.org>2007-07-29 01:11:59 -0700
commitcd4288f195f11f6c0a78bca03db009a0494da7cc (patch)
tree446645b583b627e9b2cf487a5d2fdf6bf9a28093 /tokenize.c
parent3679526ce5f88fdc1c870df3838733148af4c1ae (diff)
downloadsparse-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.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/tokenize.c b/tokenize.c
index 211a36f4..e72c56ed 100644
--- a/tokenize.c
+++ b/tokenize.c
@@ -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);
+ }
}
}