X-Git-Url: https://ncurses.scripts.mit.edu/?p=ncurses.git;a=blobdiff_plain;f=ncurses%2Ftinfo%2Fcomp_scan.c;h=08e0e7e6b797602d1a3ef3135aae134347e98eaa;hp=b5ee44830a2a074f918f7874f9d5030d5c256f33;hb=deb0d07e8eb4803b9e9653359eab17a30d04369d;hpb=643ec2bf782cd02efafe3ccdeaea8920a404645e diff --git a/ncurses/tinfo/comp_scan.c b/ncurses/tinfo/comp_scan.c index b5ee4483..08e0e7e6 100644 --- a/ncurses/tinfo/comp_scan.c +++ b/ncurses/tinfo/comp_scan.c @@ -51,7 +51,7 @@ #include #include -MODULE_ID("$Id: comp_scan.c,v 1.110 2021/09/04 10:54:35 tom Exp $") +MODULE_ID("$Id: comp_scan.c,v 1.112 2021/10/04 23:56:28 tom Exp $") /* * Maximum length of string capability we'll accept before raising an error. @@ -136,7 +136,7 @@ last_char(int from_end) while (len--) { if (!isspace(UChar(bufptr[len]))) { - if (from_end < (int) len) + if (from_end <= (int) len) result = bufptr[(int) len - from_end]; break; } @@ -587,10 +587,11 @@ _nc_get_token(bool silent) */ if (after_list != 0) { if (!silent) { - if (*after_list == '\0') + if (*after_list == '\0' || strchr("|", after_list[1]) != NULL) { _nc_warning("empty longname field"); - else if (strchr(after_list, ' ') == 0) + } else if (strchr(after_list, ' ') == 0) { _nc_warning("older tic versions may treat the description field as an alias"); + } } } else { after_list = tok_buf + strlen(tok_buf);