mirror of
git://git.code.sf.net/p/zsh/code
synced 2024-05-09 09:06:38 +02:00
Compare commits
2 Commits
21fe2dce44
...
45b0a838aa
Author | SHA1 | Date | |
---|---|---|---|
Bart Schaefer | 45b0a838aa | ||
Bart Schaefer | 326e8635fe |
|
@ -1,3 +1,10 @@
|
|||
2024-03-14 Bart Schaefer <schaefer@zsh.org>
|
||||
|
||||
* unposted: Etc/BUGS: HIST_IGNORE_DUPS mishandles quoted whitespace.
|
||||
|
||||
* 52752: Src/params.c, Test/B02typeset.ztst: more typeset -p fixes
|
||||
for local exports and improper "export -x" / "readonly -r" output.
|
||||
|
||||
2024-03-13 Bart Schaefer <schaefer@zsh.org>
|
||||
|
||||
* 52753: Doc/Zsh/grammar.yo: Clarify "nocorrect" when introducing
|
||||
|
|
5
Etc/BUGS
5
Etc/BUGS
|
@ -57,4 +57,7 @@ and thus the expression is likely to be incorrectly interpreted.
|
|||
------------------------------------------------------------------------
|
||||
52521: Empty files and unreadable files cannot be removed using the
|
||||
mapfile module "unset 'mapfile[filename]'", and are not distinguished
|
||||
from files that do not exist.
|
||||
from files that do not exist.
|
||||
------------------------------------------------------------------------
|
||||
52747,52755: HIST_IGNORE_DUPS et. al. ignore syntactically significant
|
||||
quoted whitespace and can incorrectly exclude commands as duplicates.
|
||||
|
|
21
Src/params.c
21
Src/params.c
|
@ -6044,6 +6044,7 @@ printparamnode(HashNode hn, int printflags)
|
|||
{
|
||||
Param p = (Param) hn;
|
||||
Param peer = NULL;
|
||||
int altname = 0;
|
||||
|
||||
if (!(p->node.flags & PM_HASHELEM) &&
|
||||
!(printflags & PRINT_WITH_NAMESPACE) && *(p->node.nam) == '.')
|
||||
|
@ -6089,16 +6090,26 @@ printparamnode(HashNode hn, int printflags)
|
|||
if (printflags & PRINT_POSIX_EXPORT) {
|
||||
if (!(p->node.flags & PM_EXPORTED))
|
||||
return;
|
||||
altname = 'x';
|
||||
printf("export ");
|
||||
} else if (printflags & PRINT_POSIX_READONLY) {
|
||||
if (!(p->node.flags & PM_READONLY))
|
||||
return;
|
||||
altname = 'r';
|
||||
printf("readonly ");
|
||||
} else if (locallevel && p->level >= locallevel) {
|
||||
printf("typeset "); /* printf("local "); */
|
||||
} else if ((p->node.flags & PM_EXPORTED) &&
|
||||
!(p->node.flags & (PM_ARRAY|PM_HASHED))) {
|
||||
printf("export ");
|
||||
if (p->level && p->level >= locallevel)
|
||||
printf("local ");
|
||||
else {
|
||||
altname = 'x';
|
||||
printf("export ");
|
||||
}
|
||||
} else if (locallevel && p->level >= locallevel) {
|
||||
if (p->node.flags & PM_EXPORTED)
|
||||
printf("local ");
|
||||
else
|
||||
printf("typeset "); /* printf("local "); */
|
||||
} else if (locallevel) {
|
||||
printf("typeset -g ");
|
||||
} else
|
||||
|
@ -6112,6 +6123,10 @@ printparamnode(HashNode hn, int printflags)
|
|||
|
||||
for (pmptr = pmtypes, i = 0; i < PMTYPES_SIZE; i++, pmptr++) {
|
||||
int doprint = 0;
|
||||
|
||||
if (altname && altname == pmptr->typeflag)
|
||||
continue;
|
||||
|
||||
if (pmptr->flags & PMTF_TEST_LEVEL) {
|
||||
if (p->level) {
|
||||
/*
|
||||
|
|
|
@ -311,7 +311,7 @@
|
|||
print $OUTER
|
||||
0:Export of tied parameters
|
||||
>i:n:n:e:r
|
||||
>typeset -xT OUTER outer=( i n n e r )
|
||||
>local -xT OUTER outer=( i n n e r )
|
||||
>typeset -aT OUTER outer=( i n n e r )
|
||||
>OUTER=i:n:n:e:r
|
||||
>outer=( i n n e r )
|
||||
|
@ -1099,12 +1099,12 @@
|
|||
}
|
||||
0: no array/hash in POSIX export/readonly -p
|
||||
>zsh:
|
||||
>typeset -arx zsh_exported_readonly_array=( 2 )
|
||||
>typeset -Arx zsh_exported_readonly_hash=( [3]=3 )
|
||||
>typeset -rx zsh_exported_readonly_scalar=1
|
||||
>typeset -arx zsh_exported_readonly_array=( 2 )
|
||||
>typeset -Arx zsh_exported_readonly_hash=( [3]=3 )
|
||||
>typeset -rx zsh_exported_readonly_scalar=1
|
||||
>local -arx zsh_exported_readonly_array=( 2 )
|
||||
>local -Arx zsh_exported_readonly_hash=( [3]=3 )
|
||||
>local -rx zsh_exported_readonly_scalar=1
|
||||
>local -arx zsh_exported_readonly_array=( 2 )
|
||||
>local -Arx zsh_exported_readonly_hash=( [3]=3 )
|
||||
>local -rx zsh_exported_readonly_scalar=1
|
||||
>sh:
|
||||
>export zsh_exported_readonly_scalar=1
|
||||
>readonly zsh_exported_readonly_scalar=1
|
||||
|
|
Loading…
Reference in New Issue