Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: how does setopt -m work?



mason@xxxxxxxxxxxxxxx wrote:

> Sweth Chandramouli <sweth@xxxxxxxxxxxxxxxxxxxx> typed:
> :	the subject pretty much says it all; what am i missing
> :here:
> :(astaroth/2)~: setopt -m "auto_r*"
> :(astaroth/3)~: setopt 
> :interactive
> :monitor
> :norcs
> :shinstdin
> :zle
> 
> It's probably a bug that it doesn't rip out the underscores when
> doing its matching.  ``setopt -m "autor*"'' will work.  The other
> thing to check would be case sensitivity.

Maybe, yes.

Bye
 Sven

--- os/options.c	Mon Mar  8 09:06:26 1999
+++ Src/options.c	Thu Mar 11 09:29:20 1999
@@ -522,11 +522,20 @@
 	/* Globbing option (-m) set. */
 	while (*args) {
 	    Comp com;
+	    char *s, *t;
+
+	    t = p = dupstring(*args);
+	    while (*t)
+		if (*t == '_')
+		    chuck(t);
+		else {
+		    *t = tulower(*t);
+		    t++;
+		}
 
 	    /* Expand the current arg. */
-	    tokenize(*args);
-	    if (!(com = parsereg(*args))) {
-		untokenize(*args);
+	    tokenize(s);
+	    if (!(com = parsereg(s))) {
 		zwarnnam(nam, "bad pattern: %s", *args, 0);
 		continue;
 	    }

--
Sven Wischnowsky                         wischnow@xxxxxxxxxxxxxxxxxxxxxxx



Messages sorted by: Reverse Date, Date, Thread, Author