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

PATCH: Re: PATCH: 3.1.5-pws-14: Re: bar='#pat'; ${foo/$bar/...} problem



On Apr 2,  3:13am, Bart Schaefer wrote:
} Subject: PATCH: 3.1.5-pws-14: Re: bar='#pat'; ${foo/$bar/...} problem
}
} Hopefully, I did a better job of patching than I did of noticing which
} message's headers I was reading the X-Seq: from.

Not too bad, but I noticed that bash lets you quote the leading # or %
like this: ${foo/\\$pat/$repl}

I think this handles it:

Index: Src/subst.c
===================================================================
--- subst.c	1999/04/02 11:26:29	1.23
+++ subst.c	1999/04/02 11:27:33
@@ -1371,6 +1371,8 @@
 			if (*s == '%')
 			    flags |= SUB_END;
 			s++;
+		    } else if (*s == '\\') {
+			s++;
 		    }
 		}
 	    }

-- 
Bart Schaefer                                 Brass Lantern Enterprises
http://www.well.com/user/barts              http://www.brasslantern.com



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