Skip to content

Commit 2683e34

Browse files
dschojeremyd2019
authored andcommitted
Introduce the enable_pcon value for MSYS
It is simply the negation of `disable_pcon`, i.e. `MSYS=enable_pcon` is equivalent to `MSYS=nodisable_pcon` (the former is slightly more intuitive than the latter) and likewise `MSYS=noenable_pcon` is equivalent to `MSYS=disable_pcon` (here, the latter is definitely more intuitive than the former). This is needed because we just demoted the pseudo console feature to be opt-in instead of opt-out, and it would be awkward to recommend to users to use "nodisable_pcon"... "nodisable" is not even a verb. Signed-off-by: Johannes Schindelin <[email protected]>
1 parent 36f2f7b commit 2683e34

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

winsup/cygwin/environ.cc

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ enum settings
4242
isfunc,
4343
setdword,
4444
setbool,
45+
setnegbool,
4546
setbit
4647
};
4748

@@ -118,6 +119,7 @@ static struct parse_thing
118119
} known[] NO_COPY =
119120
{
120121
{"disable_pcon", {&disable_pcon}, setbool, NULL, {{false}, {true}}},
122+
{"enable_pcon", {&disable_pcon}, setnegbool, NULL, {{true}, {false}}},
121123
{"error_start", {func: error_start_init}, isfunc, NULL, {{0}, {0}}},
122124
{"export", {&export_settings}, setbool, NULL, {{false}, {true}}},
123125
{"glob", {func: glob_init}, isfunc, NULL, {{0}, {s: "normal"}}},
@@ -244,6 +246,13 @@ parse_options (const char *inbuf)
244246
*k->setting.b = !!strtol (eq, NULL, 0);
245247
debug_printf ("%s%s", *k->setting.b ? "" : "no", k->name);
246248
break;
249+
case setnegbool:
250+
if (!istrue || !eq)
251+
*k->setting.b = k->values[istrue].i;
252+
else
253+
*k->setting.b = !strtol (eq, NULL, 0);
254+
debug_printf ("%s%s", !*k->setting.b ? "" : "no", k->name);
255+
break;
247256
case setbit:
248257
*k->setting.x &= ~k->values[istrue].i;
249258
if (istrue || (eq && strtol (eq, NULL, 0)))

0 commit comments

Comments
 (0)