Commit e55c1670 authored by Mikael Magnusson's avatar Mikael Magnusson

35476: Allow setting $0 when POSIX_ARGZERO is not set

parent 2cfe8924
......@@ -3,6 +3,9 @@
* 35477: Completion/Unix/Command/_gdb: _gdb: Allow 'core' to
occur anywhere in a coredump filename
* 35476: Src/params.c: Allow setting $0 when POSIX_ARGZERO is
not set
2015-06-16 Barton E. Schaefer <schaefer@zsh.org>
* 35493: Src/exec.c: erase $_ when the command line is an assignment
......
......@@ -196,7 +196,7 @@ static const struct gsu_integer ttyidle_gsu =
{ ttyidlegetfn, nullintsetfn, stdunsetfn };
static const struct gsu_scalar argzero_gsu =
{ argzerogetfn, nullstrsetfn, nullunsetfn };
{ argzerogetfn, argzerosetfn, nullunsetfn };
static const struct gsu_scalar username_gsu =
{ usernamegetfn, usernamesetfn, stdunsetfn };
static const struct gsu_scalar dash_gsu =
......@@ -4044,6 +4044,21 @@ lcsetfn(Param pm, char *x)
}
#endif /* USE_LOCALE */
/* Function to set value for special parameter `0' */
/**/
static void
argzerosetfn(UNUSED(Param pm), char *x)
{
if (x) {
if (!isset(POSIXARGZERO)) {
zsfree(argzero);
argzero = ztrdup(x);
}
zsfree(x);
}
}
/* Function to get value for special parameter `0' */
/**/
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment