1
0
Fork 0
mirror of git://git.code.sf.net/p/zsh/code synced 2025-11-24 01:50:54 +01:00

51510: Skip namespaces in "set"/"typeset" output, add tests, fix bug

This commit is contained in:
Bart Schaefer 2023-03-06 20:01:04 -08:00
parent 0562be0af8
commit 8d009d35a9
6 changed files with 130 additions and 8 deletions

View file

@ -4319,13 +4319,13 @@ itype_end(const char *ptr, int itype, int once)
{
if (itype == INAMESPC) {
itype = IIDENT;
if (once == 0 && (!isset(POSIXIDENTIFIERS) || EMULATION(EMULATE_KSH))) {
if (!isset(POSIXIDENTIFIERS) || EMULATION(EMULATE_KSH)) {
/* Special case for names containing ".", ksh93 namespaces */
char *t = itype_end(ptr + (*ptr == '.'), itype, 0);
if (t > ptr+1) {
if (t > ptr + (*ptr == '.')) {
if (*t == '.')
return itype_end(t+1, itype, 0);
else
ptr = t + 1; /* Fall through */
else if (!once)
return t;
}
}