rcfile: when an old flag is unset, set the corresponding new flag

This fixes https://savannah.gnu.org/bugs/?55583.
This commit is contained in:
Benno Schulenberg 2019-01-28 19:55:04 +01:00
parent 4d40bea58a
commit 556c0a3865

View File

@ -2407,6 +2407,16 @@ int main(int argc, char **argv)
if (tabsize_cmdline != -1)
tabsize = tabsize_cmdline;
/* If an rcfile undid the default settings, copy it to the new flags. */
if (!ISSET(NO_WRAP))
SET(BREAK_LONG_LINES);
if (!ISSET(NO_NEWLINES))
SET(FINAL_NEWLINE);
if (!ISSET(SMOOTH_SCROLL))
SET(JUMPY_SCROLLING);
if (!ISSET(MORE_SPACE))
SET(EMPTY_LINE);
/* Simply OR the boolean flags from rcfile and command line. */
for (size_t i = 0; i < sizeof(flags) / sizeof(flags[0]); i++)
flags[i] |= flags_cmdline[i];