tweaks: reshuffle some lines, to group things more sensibly
parent
7028adf211
commit
b55923f5ec
24
src/rcfile.c
24
src/rcfile.c
|
@ -1151,25 +1151,23 @@ void parse_rcfile(FILE *rcstream, bool syntax_only, bool headers_only)
|
|||
continue;
|
||||
}
|
||||
|
||||
/* First handle unsetting. */
|
||||
if (set == -1) {
|
||||
if (rcopts[i].flag != 0)
|
||||
UNSET(rcopts[i].flag);
|
||||
/* If the option has a flag, set it or unset it, as requested. */
|
||||
if (rcopts[i].flag) {
|
||||
if (set == 1)
|
||||
SET(rcopts[i].flag);
|
||||
else
|
||||
UNSET(rcopts[i].flag);
|
||||
continue;
|
||||
}
|
||||
|
||||
/* An option that takes an argument cannot be unset. */
|
||||
if (set == -1) {
|
||||
rcfile_error(N_("Cannot unset option \"%s\""), rcopts[i].name);
|
||||
continue;
|
||||
}
|
||||
|
||||
/* If the option has a flag, it doesn't take an argument. */
|
||||
if (rcopts[i].flag != 0) {
|
||||
SET(rcopts[i].flag);
|
||||
continue;
|
||||
}
|
||||
|
||||
/* The option doesn't have a flag, so it takes an argument. */
|
||||
if (*ptr == '\0') {
|
||||
rcfile_error(N_("Option \"%s\" requires an argument"),
|
||||
rcopts[i].name);
|
||||
rcfile_error(N_("Option \"%s\" requires an argument"), rcopts[i].name);
|
||||
continue;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue