mirror of
https://github.com/zsh-users/zsh
synced 2024-09-06 00:14:40 +00:00
35476: Allow setting $0 when POSIX_ARGZERO is not set
This commit is contained in:
parent
2cfe892414
commit
e55c167083
|
@ -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
|
||||
|
|
17
Src/params.c
17
Src/params.c
|
@ -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' */
|
||||
|
||||
/**/
|
||||
|
|
Loading…
Reference in a new issue