diff options
author | Clint Adams <clint@users.sourceforge.net> | 2001-12-16 20:53:44 +0000 |
---|---|---|
committer | Clint Adams <clint@users.sourceforge.net> | 2001-12-16 20:53:44 +0000 |
commit | 1e103ebef330694fe94889127df2c166aa4804a1 (patch) | |
tree | c730f3b2d1833f8b1e6df853d40386d2d4f7c4d6 /Src/params.c | |
parent | 2c71f2ce29055c14083de7cc62b0bd6e652c712f (diff) | |
download | zsh-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.c | 17 |
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' */ /**/ |