mirror of
https://salsa.debian.org/dskoll/remind.git
synced 2026-04-16 06:18:47 +02:00
Stricter parsing of '-i' option.
This commit is contained in:
@@ -926,7 +926,12 @@ static void InitializeVar(char const *str)
|
||||
r = 0;
|
||||
while (*str && *str != '=') {
|
||||
if (r < VAR_NAME_LEN) {
|
||||
varname[r++] = *str;
|
||||
if (isalpha(*str) || *str == '_' || (r > 0 && *str == '(') || (r == 0 && *str == '$') || (r > 0 && isdigit(*str))) {
|
||||
varname[r++] = *str;
|
||||
} else {
|
||||
fprintf(ErrFp, ErrMsg[M_I_OPTION], ErrMsg[E_ILLEGAL_CHAR]);
|
||||
return;
|
||||
}
|
||||
}
|
||||
if (*str == '(') {
|
||||
/* Do a function definition if we see a paren */
|
||||
|
||||
@@ -201,6 +201,13 @@ int DoFset(ParsePtr p)
|
||||
return E_PARSE_ERR;
|
||||
}
|
||||
|
||||
while(*(p->pos) && isspace(*(p->pos))) {
|
||||
p->pos++;
|
||||
}
|
||||
if (!*(p->pos)) {
|
||||
DestroyUserFunc(func);
|
||||
return E_EOLN;
|
||||
}
|
||||
func->text = StrDup(p->pos);
|
||||
if (!func->text) {
|
||||
DestroyUserFunc(func);
|
||||
|
||||
Reference in New Issue
Block a user