summary refs log tree commit diff
path: root/Src/Zle/computil.c
diff options
context:
space:
mode:
authorSven Wischnowsky <wischnow@users.sourceforge.net>2000-04-11 07:57:56 +0000
committerSven Wischnowsky <wischnow@users.sourceforge.net>2000-04-11 07:57:56 +0000
commitfac3086d9782e73dcaf1aa65fd36a0b63a374719 (patch)
tree7bab35e2787ca17f02ec932dffae1bfff2ffcfe3 /Src/Zle/computil.c
parent37012f06a7e5e8a64614dbf9032c77cff1bcfcfb (diff)
downloadzsh-fac3086d9782e73dcaf1aa65fd36a0b63a374719.tar.gz
zsh-fac3086d9782e73dcaf1aa65fd36a0b63a374719.tar.xz
zsh-fac3086d9782e73dcaf1aa65fd36a0b63a374719.zip
_wanted now tests both tags and labels; change places where _wanted was called without a command; allow multiple patterns per string in file-patterns; update _next_tags to work with labels (10632)
Diffstat (limited to 'Src/Zle/computil.c')
-rw-r--r--Src/Zle/computil.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/Src/Zle/computil.c b/Src/Zle/computil.c
index e73fe8eaf..09746c1bb 100644
--- a/Src/Zle/computil.c
+++ b/Src/Zle/computil.c
@@ -2291,7 +2291,7 @@ bin_comptags(char *nam, char **args, char *ops, int func)
     case 'N': min = 0; max =  0; break;
     case 'R': min = 1; max =  1; break;
     case 'S': min = 1; max =  1; break;
-    case 'A': min = 2; max =  2; break;
+    case 'A': min = 2; max =  3; break;
     default:
 	zwarnnam(nam, "invalid option: %s", args[0], 0);
 	return 1;
@@ -2365,6 +2365,14 @@ bin_comptags(char *nam, char **args, char *ops, int func)
 		}
 		s->ptr = q + 1;
 		setsparam(args[2], ztrdup(*v == '-' ? dyncat(args[1], v) : v));
+		if (args[3]) {
+		    char *r = dupstring(*q), *p;
+
+		    for (p = r + (v - *q); *p && *p != ':'; p++);
+		    *p = '\0';
+
+		    setsparam(args[3], ztrdup(r));
+		}
 		return 0;
 	    }
 	    return 1;