mirror of
git://git.code.sf.net/p/zsh/code
synced 2025-10-14 11:41:07 +02:00
Fix remaining existing tests.
XTRACE output for builtins with assignment arguments added. Note difference as the output is assignment-like too: 'foo=<squggle><squiggle>bar' now appears as foo='<squiggle><squiggle>bar' Remove stupid "int htok" that stopped name part of scalar being expanded. Rewrite KSH_TYPESET test to use old builtin interface where this applies.
This commit is contained in:
parent
2dcd766f62
commit
b7b67d456e
4 changed files with 34 additions and 2 deletions
|
@ -443,6 +443,28 @@ execbuiltin(LinkList args, LinkList assigns, Builtin bn)
|
|||
fputc(' ', xtrerr);
|
||||
quotedzputs(*fullargv++, xtrerr);
|
||||
}
|
||||
if (assigns) {
|
||||
LinkNode node;
|
||||
for (node = firstnode(assigns); node; incnode(node)) {
|
||||
Asgment asg = (Asgment)node;
|
||||
fputc(' ', xtrerr);
|
||||
quotedzputs(asg->name, xtrerr);
|
||||
if (asg->is_array) {
|
||||
LinkNode arrnode;
|
||||
fprintf(xtrerr, "=(");
|
||||
for (arrnode = firstnode(asg->value.array);
|
||||
arrnode;
|
||||
incnode(arrnode)) {
|
||||
fputc(' ', xtrerr);
|
||||
quotedzputs((char *)getdata(arrnode), xtrerr);
|
||||
}
|
||||
fprintf(xtrerr, " )");
|
||||
} else if (asg->value.scalar) {
|
||||
fputc('=', xtrerr);
|
||||
quotedzputs(asg->value.scalar, xtrerr);
|
||||
}
|
||||
}
|
||||
}
|
||||
fputc('\n', xtrerr);
|
||||
fflush(xtrerr);
|
||||
}
|
||||
|
|
|
@ -3488,7 +3488,6 @@ execcmd(Estate state, int input, int output, int how, int last1)
|
|||
wordcode ac = *state->pc++;
|
||||
char *name = ecgetstr(state, EC_DUPTOK, &htok);
|
||||
Asgment asg;
|
||||
int htok;
|
||||
local_list1(svl);
|
||||
|
||||
DPUTS(wc_code(ac) != WC_ASSIGN,
|
||||
|
|
|
@ -199,5 +199,5 @@
|
|||
?+zsh_directory_name:4> [[ d == n ]]
|
||||
?+zsh_directory_name:12> [[ <parent>/very_long_directory_name == (#b)(*)/very_long_directory_name ]]
|
||||
?+zsh_directory_name:14> return 0
|
||||
?+fn:7> local 'd=~[<parent>:l]'
|
||||
?+fn:7> local d='~[<parent>:l]'
|
||||
?+fn:8> print '~[<parent>:l]'
|
||||
|
|
|
@ -570,6 +570,15 @@
|
|||
>unset
|
||||
>globassign
|
||||
|
||||
# This test is now somewhat artificial as
|
||||
# KSH_TYPESET only applies to the builtin
|
||||
# interface. Tests to the more standard
|
||||
# reserved word interface appear elsewhere.
|
||||
(
|
||||
# reserved words are handled during parsing,
|
||||
# hence eval...
|
||||
disable -r typeset
|
||||
eval '
|
||||
setopt kshtypeset
|
||||
ktvars=(ktv1 ktv2)
|
||||
typeset ktfoo=`echo arg1 arg2` $ktvars
|
||||
|
@ -580,6 +589,8 @@
|
|||
print $noktfoo
|
||||
print $+noktarg1 $+noktarg2
|
||||
unset ktfoo ktv1 ktv2 noktfoo noktarg2
|
||||
'
|
||||
)
|
||||
0:KSH_TYPESET option
|
||||
>1 1 0
|
||||
>arg1 arg2
|
||||
|
|
Loading…
Reference in a new issue