git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andreas Schwab <schwab@linux-m68k.org>
To: Ben Walton <bwalton@artsci.utoronto.ca>
Cc: gitster@pobox.com, git@vger.kernel.org
Subject: Re: [PATCH] Avoid bug in Solaris xpg4/sed as used in submodule
Date: Mon, 09 Apr 2012 08:40:03 +0200	[thread overview]
Message-ID: <m2sjgde7cs.fsf@linux-m68k.org> (raw)
In-Reply-To: <1333935414-10389-1-git-send-email-bwalton@artsci.utoronto.ca> (Ben Walton's message of "Sun, 8 Apr 2012 21:36:54 -0400")

Ben Walton <bwalton@artsci.utoronto.ca> writes:

> The sed provided by Solaris in /usr/xpg4/bin has a bug whereby an
> unanchored regex using * for zero or more repetitions sees two
> separate matches fed to the substitution engine in some cases.
>
> This is evidenced by:
>
> $ for sed in /usr/xpg4/bin/sed /usr/bin/sed /opt/csw/gnu/sed; do \
> echo 'ab' | $sed -e 's|[a]*|X|g'; \
> done
> XXbX
> XbX
> XbX
>
> This bug was triggered during a git submodule clone operation as
> exercised in the setup stage of t5526-fetch-submodules when using the
> default SANE_TOOL_PATH for Solaris.  It led to paths such as
> ..../.. being used in the submodule .git gitdir reference.
>
> Using the expression 's|\([^/]*\(/*\)\)|..\2|g' provides the desired

How about using 's|[^/][^/]*|..|g' instead, which should avoid the bug
as well.

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."

  reply	other threads:[~2012-04-09  6:40 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 [this message]
2012-04-09 13:30   ` Ben Walton
2012-04-09 15:09     ` Andreas Schwab
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=m2sjgde7cs.fsf@linux-m68k.org \
    --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 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).