mirror of
https://salsa.debian.org/dskoll/remind.git
synced 2026-04-16 06:18:47 +02:00
Allow '-i$foo' to be interpreted as '-i$foo=0'
This commit is contained in:
16
src/init.c
16
src/init.c
@@ -1017,17 +1017,15 @@ static void InitializeVar(char const *str)
|
||||
return;
|
||||
}
|
||||
if (!*str) {
|
||||
/* Setting a system var does require =expr on the commandline */
|
||||
if (*varname == '$') {
|
||||
fprintf(ErrFp, GetErr(M_I_OPTION), GetErr(E_MISS_EQ));
|
||||
fprintf(ErrFp, "\n");
|
||||
return;
|
||||
}
|
||||
val.type = INT_TYPE;
|
||||
val.v.val = 0;
|
||||
r = SetVar(varname, &val, 1);
|
||||
if (!r) {
|
||||
r = PreserveVar(varname);
|
||||
if (*varname == '$') {
|
||||
r = SetSysVar(varname+1, &val);
|
||||
} else {
|
||||
r = SetVar(varname, &val, 1);
|
||||
if (!r) {
|
||||
r = PreserveVar(varname);
|
||||
}
|
||||
}
|
||||
if (r) {
|
||||
fprintf(ErrFp, GetErr(M_I_OPTION), GetErr(r));
|
||||
|
||||
Reference in New Issue
Block a user