/****************************************************************************
- * Copyright (c) 1998-2016,2017 Free Software Foundation, Inc. *
+ * Copyright 2020,2021 Thomas E. Dickey *
+ * Copyright 1998-2016,2017 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 *
#include <ctype.h>
#include <tic.h>
-MODULE_ID("$Id: comp_scan.c,v 1.108 2017/08/25 22:57:21 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.
while (len--) {
if (!isspace(UChar(bufptr[len]))) {
- if (from_end < (int) len)
+ if (from_end <= (int) len)
result = bufptr[(int) len - from_end];
break;
}
* Grrr...what we ought to do here is barf, complaining that
* the entry is malformed. But because a couple of name fields
* in the 8.2 termcap file end with |\, we just have to assume
- * it's termcap syntax.
+ * it is termcap syntax.
*/
_nc_syntax = SYN_TERMCAP;
separator = ':';
*/
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);