From 49e81cada73616864b9b31df0aeb6961c30f5a6e Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Mon, 6 Apr 2009 06:40:57 +0000 Subject: apply getline() fix from linux kernel --- extra/scripts/unifdef.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/extra/scripts/unifdef.c b/extra/scripts/unifdef.c index 0eb0d0900..5d1171e4d 100644 --- a/extra/scripts/unifdef.c +++ b/extra/scripts/unifdef.c @@ -206,7 +206,7 @@ static void done(void); static void error(const char *); static int findsym(const char *); static void flushline(bool); -static Linetype getline(void); +static Linetype get_line(void); static Linetype ifeval(const char **); static void ignoreoff(void); static void ignoreon(void); @@ -517,7 +517,7 @@ process(void) for (;;) { linenum++; - lineval = getline(); + lineval = get_line(); trans_table[ifstate[depth]][lineval](); debug("process %s -> %s depth %d", linetype_name[lineval], @@ -531,7 +531,7 @@ process(void) * help from skipcomment(). */ static Linetype -getline(void) +get_line(void) { const char *cp; int cursym; @@ -889,9 +889,8 @@ skipcomment(const char *cp) cp += 1; } else if (strchr(" \t", *cp) != NULL) { cp += 1; - } else { + } else return (cp); - } continue; case CXX_COMMENT: if (strncmp(cp, "\n", 1) == 0) { -- cgit v1.2.3