From: Andreas Schwab <schwab@linux-m68k.org>
To: Ben Walton <bwalton@artsci.utoronto.ca>
Cc: gitster <gitster@pobox.com>, git <git@vger.kernel.org>
Subject: Re: [PATCH] Avoid bug in Solaris xpg4/sed as used in submodule
Date: Mon, 09 Apr 2012 17:09:13 +0200 [thread overview]
Message-ID: <m2fwcdc57q.fsf@igel.home> (raw)
In-Reply-To: <1333977812-sup-4111@pinkfloyd.chass.utoronto.ca> (Ben Walton's message of "Mon, 09 Apr 2012 09:30:37 -0400")
Ben Walton <bwalton@artsci.utoronto.ca> writes:
> Excerpts from Andreas Schwab's message of Mon Apr 09 02:40:03 -0400 2012:
>
>> How about using 's|[^/][^/]*|..|g' instead, which should avoid the bug
>> as well.
>
> I'd be ok with that change if the changed semantics of the regex are
> ok in this application. It's essentially the same as s|[^/]+|..|g,
> which requires at least one character.
>
> In the current code, if you do:
>
> echo '/' | sed -e 's|[^]*|..|g'
>
> you get: ../.. (from a working implementation).
>
> Your regex would see the result be: /
>
> I don't think we'd ever be passing a plain /, but we might pass a
> fully qualified path /path/to/foo, which would see the result change
> from ../../../.. to /../../.. and that could have unintended impact.
AFAICS the variables at this point never contain a value with a leading
slash.
Andreas.
--
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5
"And now for something completely different."
next prev parent reply other threads:[~2012-04-09 15:09 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-04-09 1:36 [PATCH] Avoid bug in Solaris xpg4/sed as used in submodule Ben Walton
2012-04-09 6:40 ` Andreas Schwab
2012-04-09 13:30 ` Ben Walton
2012-04-09 15:09 ` Andreas Schwab [this message]
2012-04-09 18:44 ` Junio C Hamano
2012-04-09 18:47 ` Ben Walton
2012-04-09 20:08 ` Ben Walton
2012-04-09 21:07 ` Andreas Schwab
2012-04-09 21:48 ` Junio C Hamano
2012-04-10 0:13 ` Ben Walton
2012-04-10 0:31 ` Junio C Hamano
2012-04-10 0:40 ` Ben Walton
2012-04-10 1:05 ` Junio C Hamano
2012-04-10 8:31 ` Andreas Schwab
2012-04-10 16:10 ` Junio C Hamano
2012-04-13 0:46 ` Ben Walton
2012-04-13 0:48 ` Ben Walton
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=m2fwcdc57q.fsf@igel.home \
--to=schwab@linux-m68k.org \
--cc=bwalton@artsci.utoronto.ca \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
/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.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.