X-Git-Url: http://ncurses.scripts.mit.edu/?p=ncurses.git;a=blobdiff_plain;f=ncurses%2Ftinfo%2Fcomp_scan.c;h=36674c4bb6b6e4555215bdb1afdcad3b56a12fed;hp=2a9aa56371c8b3a1fca9de394a8d7b96aaa418a5;hb=90d42867e1296bc79021006a92032c76e59068b6;hpb=64f44b13d30e0a7bc2921a9d43755423f81564fd diff --git a/ncurses/tinfo/comp_scan.c b/ncurses/tinfo/comp_scan.c index 2a9aa563..36674c4b 100644 --- a/ncurses/tinfo/comp_scan.c +++ b/ncurses/tinfo/comp_scan.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2011,2012 Free Software Foundation, Inc. * + * Copyright (c) 1998-2013,2016 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -50,7 +50,7 @@ #include #include -MODULE_ID("$Id: comp_scan.c,v 1.101 2012/12/08 22:19:25 tom Exp $") +MODULE_ID("$Id: comp_scan.c,v 1.103 2016/05/28 23:22:52 tom Exp $") /* * Maximum length of string capability we'll accept before raising an error. @@ -189,12 +189,11 @@ next_char(void) * quite hard to get completely right. Try it and see. If you * succeed, don't forget to hack push_back() correspondingly. */ - size_t used; size_t len; do { + size_t used = 0; bufstart = 0; - used = 0; do { if (used + (LEXBUFSIZ / 4) >= allocated) { allocated += (allocated + LEXBUFSIZ); @@ -380,7 +379,7 @@ _nc_get_token(bool silent) if (end_of_stream()) { yyin = 0; - (void) next_char(); /* frees its allocated memory */ + (void) next_char(); /* frees its allocated memory */ if (tok_buf != 0) { if (_nc_curr_token.tk_name == tok_buf) _nc_curr_token.tk_name = 0; @@ -432,7 +431,7 @@ _nc_get_token(bool silent) #if NCURSES_EXT_FUNCS && !(ch == '.' && _nc_disable_period) #endif - && !strchr(terminfo_punct, (char) ch)) { + && ((strchr) (terminfo_punct, (char) ch) == 0)) { if (!silent) _nc_warning("Illegal character (expected alphanumeric or %s) - '%s'", terminfo_punct, unctrl(UChar(ch))); @@ -990,10 +989,8 @@ _nc_push_token(int tokclass) NCURSES_EXPORT(void) _nc_panic_mode(char ch) { - int c; - for (;;) { - c = next_char(); + int c = next_char(); if (c == ch) return; if (c == EOF)