tweaks: reshuffle some lines, to group things more sensibly

master
Benno Schulenberg 2019-06-13 19:55:43 +02:00
parent 7028adf211
commit b55923f5ec
1 changed files with 9 additions and 11 deletions

View File

@ -1151,25 +1151,23 @@ void parse_rcfile(FILE *rcstream, bool syntax_only, bool headers_only)
continue; continue;
} }
/* First handle unsetting. */ /* If the option has a flag, set it or unset it, as requested. */
if (set == -1) { if (rcopts[i].flag) {
if (rcopts[i].flag != 0) if (set == 1)
UNSET(rcopts[i].flag); SET(rcopts[i].flag);
else else
rcfile_error(N_("Cannot unset option \"%s\""), rcopts[i].name); UNSET(rcopts[i].flag);
continue; continue;
} }
/* If the option has a flag, it doesn't take an argument. */ /* An option that takes an argument cannot be unset. */
if (rcopts[i].flag != 0) { if (set == -1) {
SET(rcopts[i].flag); rcfile_error(N_("Cannot unset option \"%s\""), rcopts[i].name);
continue; continue;
} }
/* The option doesn't have a flag, so it takes an argument. */
if (*ptr == '\0') { if (*ptr == '\0') {
rcfile_error(N_("Option \"%s\" requires an argument"), rcfile_error(N_("Option \"%s\" requires an argument"), rcopts[i].name);
rcopts[i].name);
continue; continue;
} }