about summary refs log tree commit diff
path: root/Src/params.c
diff options
context:
space:
mode:
authorClint Adams <clint@users.sourceforge.net>2001-12-16 20:53:44 +0000
committerClint Adams <clint@users.sourceforge.net>2001-12-16 20:53:44 +0000
commit1e103ebef330694fe94889127df2c166aa4804a1 (patch)
treec730f3b2d1833f8b1e6df853d40386d2d4f7c4d6 /Src/params.c
parent2c71f2ce29055c14083de7cc62b0bd6e652c712f (diff)
downloadzsh-1e103ebef330694fe94889127df2c166aa4804a1.tar.gz
zsh-1e103ebef330694fe94889127df2c166aa4804a1.tar.xz
zsh-1e103ebef330694fe94889127df2c166aa4804a1.zip
16345: (n) flag to remove duplicate array values during expansion.
Diffstat (limited to 'Src/params.c')
-rw-r--r--Src/params.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/Src/params.c b/Src/params.c
index 22346896d..cb08b4e6a 100644
--- a/Src/params.c
+++ b/Src/params.c
@@ -2490,6 +2490,23 @@ uniqarray(char **x)
 	    }
 }
 
+/**/
+void
+zhuniqarray(char **x)
+{
+    char **t, **p = x;
+
+    if (!x || !*x)
+	return;
+    while (*++p)
+	for (t = x; t < p; t++)
+	    if (!strcmp(*p, *t)) {
+		*p = NULL;
+		for (t = p--; (*t = t[1]) != NULL; t++);
+		break;
+	    }
+}
+
 /* Function to get value of special parameter `#' and `ARGC' */
 
 /**/