about summary refs log tree commit diff
path: root/Src/utils.c
diff options
context:
space:
mode:
authorBart Schaefer <schaefer@zsh.org>2023-03-06 20:01:04 -0800
committerBart Schaefer <schaefer@zsh.org>2023-03-06 20:01:04 -0800
commit8d009d35a9eeacb1bbe9399316d2649a47102014 (patch)
tree54b21c0628dd1196c32bc83b8db7f50a9308e4cd /Src/utils.c
parent0562be0af8127bb728774de47e4e8851461bd8e2 (diff)
downloadzsh-8d009d35a9eeacb1bbe9399316d2649a47102014.tar.gz
zsh-8d009d35a9eeacb1bbe9399316d2649a47102014.tar.xz
zsh-8d009d35a9eeacb1bbe9399316d2649a47102014.zip
51510: Skip namespaces in "set"/"typeset" output, add tests, fix bug
Diffstat (limited to 'Src/utils.c')
-rw-r--r--Src/utils.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/Src/utils.c b/Src/utils.c
index 8ce9a175d..14ff0ed47 100644
--- a/Src/utils.c
+++ b/Src/utils.c
@@ -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;
 	    }
 	}