Skip to content

Commit

Permalink
Introduce the enable_pcon value for MSYS
Browse files Browse the repository at this point in the history
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 <johannes.schindelin@gmx.de>
  • Loading branch information
dscho authored and lazka committed Aug 25, 2024
1 parent 4b69189 commit 245f165
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions winsup/cygwin/environ.cc
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ enum settings
isfunc,
setdword,
setbool,
setnegbool,
setbit
};

Expand Down Expand Up @@ -118,6 +119,7 @@ static struct parse_thing
} known[] NO_COPY =
{
{"disable_pcon", {&disable_pcon}, setbool, NULL, {{false}, {true}}},
{"enable_pcon", {&disable_pcon}, setnegbool, NULL, {{true}, {false}}},
{"error_start", {func: error_start_init}, isfunc, NULL, {{0}, {0}}},
{"export", {&export_settings}, setbool, NULL, {{false}, {true}}},
{"glob", {func: glob_init}, isfunc, NULL, {{0}, {s: "normal"}}},
Expand Down Expand Up @@ -244,6 +246,13 @@ parse_options (const char *inbuf)
*k->setting.b = !!strtol (eq, NULL, 0);
debug_printf ("%s%s", *k->setting.b ? "" : "no", k->name);
break;
case setnegbool:
if (!istrue || !eq)
*k->setting.b = k->values[istrue].i;
else
*k->setting.b = !strtol (eq, NULL, 0);
debug_printf ("%s%s", !*k->setting.b ? "" : "no", k->name);
break;
case setbit:
*k->setting.x &= ~k->values[istrue].i;
if (istrue || (eq && strtol (eq, NULL, 0)))
Expand Down

0 comments on commit 245f165

Please sign in to comment.