still more #saveoptions and cond_ options
If any cond_xyz options came from the old RC file or were changed with 'm O' but they were all back to their default values when #saveoptions was executed, the new RC file would end up with 'OPTIONS=\n' at the end. Then if that RC file gets loaded in a subsequent game, there will be a warning about "Empty statement".
This commit is contained in:
+12
-3
@@ -9421,6 +9421,10 @@ option_help(void)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* gather all non-default cond_xyz options into one OPTIONS=cond_foo,!cond_bar
|
||||||
|
entry spread across multiple lines with backslash+newline if needed;
|
||||||
|
conditions with their default settings (cond_blind, !cond_glowhands, &c)
|
||||||
|
are excluded */
|
||||||
static void
|
static void
|
||||||
all_options_conds(strbuf_t *sbuf)
|
all_options_conds(strbuf_t *sbuf)
|
||||||
{
|
{
|
||||||
@@ -9449,9 +9453,14 @@ all_options_conds(strbuf_t *sbuf)
|
|||||||
}
|
}
|
||||||
++idx;
|
++idx;
|
||||||
}
|
}
|
||||||
/* finish off final line */
|
/* finish off final line; value might be empty if one or more cond_xyz
|
||||||
Strcat(buf, "\n");
|
options were changed in such a manner that that they're all back
|
||||||
strbuf_append(sbuf, buf);
|
to their default values; that will produce "OPTIONS=" will nothing
|
||||||
|
after the equals sign, if which case we need to suppress it */
|
||||||
|
if (strcmp(buf, "OPTIONS=")) {
|
||||||
|
Strcat(buf, "\n");
|
||||||
|
strbuf_append(sbuf, buf);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* append menucolor lines to strbuf */
|
/* append menucolor lines to strbuf */
|
||||||
|
|||||||
Reference in New Issue
Block a user