]> ncurses.scripts.mit.edu Git - ncurses.git/blobdiff - ncurses/tinfo/comp_scan.c
ncurses 6.0 - patch 20171209
[ncurses.git] / ncurses / tinfo / comp_scan.c
index 3ac0b75f9822c9ef83fc44a821cea2504a0a4483..b2072577a49989c50d5922e2dbf51659a6e85d3a 100644 (file)
@@ -50,7 +50,7 @@
 #include <ctype.h>
 #include <tic.h>
 
 #include <ctype.h>
 #include <tic.h>
 
-MODULE_ID("$Id: comp_scan.c,v 1.104 2017/04/08 11:30:52 tom Exp $")
+MODULE_ID("$Id: comp_scan.c,v 1.108 2017/08/25 22:57:21 tom Exp $")
 
 /*
  * Maximum length of string capability we'll accept before raising an error.
 
 /*
  * Maximum length of string capability we'll accept before raising an error.
@@ -168,6 +168,8 @@ next_char(void)
        if (result != 0) {
            FreeAndNull(result);
            FreeAndNull(pushname);
        if (result != 0) {
            FreeAndNull(result);
            FreeAndNull(pushname);
+           bufptr = 0;
+           bufstart = 0;
            allocated = 0;
        }
        /*
            allocated = 0;
        }
        /*
@@ -222,6 +224,8 @@ next_char(void)
                }
                if ((bufptr = bufstart) != 0) {
                    used = strlen(bufptr);
                }
                if ((bufptr = bufstart) != 0) {
                    used = strlen(bufptr);
+                   if (used == 0)
+                       return (EOF);
                    while (iswhite(*bufptr)) {
                        if (*bufptr == '\t') {
                            _nc_curr_col = (_nc_curr_col | 7) + 1;
                    while (iswhite(*bufptr)) {
                        if (*bufptr == '\t') {
                            _nc_curr_col = (_nc_curr_col | 7) + 1;
@@ -817,8 +821,6 @@ _nc_trans_string(char *ptr, char *last)
            }
            if (c == '?' && (_nc_syntax != SYN_TERMCAP)) {
                *(ptr++) = '\177';
            }
            if (c == '?' && (_nc_syntax != SYN_TERMCAP)) {
                *(ptr++) = '\177';
-               if (_nc_tracing)
-                   _nc_warning("Allow ^? as synonym for \\177");
            } else {
                if ((c &= 037) == 0)
                    c = 128;
            } else {
                if ((c &= 037) == 0)
                    c = 128;
@@ -831,8 +833,6 @@ _nc_trans_string(char *ptr, char *last)
            if (c == EOF)
                _nc_err_abort(MSG_NO_INPUTS);
 
            if (c == EOF)
                _nc_err_abort(MSG_NO_INPUTS);
 
-#define isoctal(c) ((c) >= '0' && (c) <= '7')
-
            if (isoctal(c) || (strict_bsd && isdigit(c))) {
                number = c - '0';
                for (i = 0; i < 2; i++) {
            if (isoctal(c) || (strict_bsd && isdigit(c))) {
                number = c - '0';
                for (i = 0; i < 2; i++) {