zsh-workers
 help / color / mirror / code / Atom feed
From: "Bart Schaefer" <schaefer@brasslantern.com>
To: "ZSH workers mailing list" <zsh-workers@sunsite.auc.dk>
Subject: PATCH: 3.1.5-pws-14: Re: bar='#pat'; ${foo/$bar/...} problem
Date: Fri, 2 Apr 1999 03:13:21 -0800	[thread overview]
Message-ID: <990402031321.ZM1039@candle.brasslantern.com> (raw)
In-Reply-To: <990402023951.ZM769@candle.brasslantern.com>

On Apr 2,  2:39am, Bart Schaefer wrote:
} Subject: Re: bar='#pat'; ${foo/$bar/...} problem
}
} Now, you might argue that the implementation of /# and /% should be as
} if # and % are extensions of the glob syntax

Index: Src/subst.c
===================================================================
--- subst.c	1999/03/29 21:45:50	1.22
+++ subst.c	1999/04/02 11:06:21
@@ -1361,7 +1361,19 @@
 			 NULL, s[-1]);
 		    return NULL;
 		}
-	    singsub(&s);
+	    {
+		char t = s[-1];
+
+		singsub(&s);
+		if (t == '/' && (flags & SUB_SUBSTR)) {
+		    if (*s == '#' || *s == '%') {
+			flags &= ~SUB_SUBSTR;
+			if (*s == '%')
+			    flags |= SUB_END;
+			s++;
+		    }
+		}
+	    }
 
 	    if (!vunset && isarr) {
 		char **ap = aval;

} (Did I get to be article 6000? :-)

(Hopefully, I did a better job of patching than I did of noticing which
message's headers I was reading the X-Seq: from.  Hard to be 6000 when
that's the one you're replying to.)

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


  reply	other threads:[~1999-04-02 11:15 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-04-01 14:04 Andrej Borsenkow
1999-04-02 10:39 ` Bart Schaefer
1999-04-02 11:13   ` Bart Schaefer [this message]
1999-04-02 11:33     ` PATCH: Re: PATCH: 3.1.5-pws-14: " Bart Schaefer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=990402031321.ZM1039@candle.brasslantern.com \
    --to=schaefer@brasslantern.com \
    --cc=zsh-workers@sunsite.auc.dk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).