diff options
author | Paul Eggert <eggert@twinsun.com> | 2008-04-24 16:15:40 +0200 |
---|---|---|
committer | Paolo Bonzini <bonzini@gnu.org> | 2008-04-24 16:22:56 +0200 |
commit | eb8496d9deeab994ffbc13850ecb6c612889c616 (patch) | |
tree | d7182cb26b37935aa64136074e52a03d857a1f26 /sed | |
parent | f11ba2aec30bc8451c9b068d0a9b547439eab1ff (diff) | |
download | sed-eb8496d9deeab994ffbc13850ecb6c612889c616.tar.gz |
treat 's&foo&\&&' compatibly with traditional 'sed'
2008-04-24 Paul Eggert <eggert@twinsun.com>
* sed/compile.c (match_slash): Treat 's&foo&\&&' compatibly with
traditional 'sed'.
* testsuite/bsd.sh: Add test case for this.
* testsuite/bsd.good: Add test case output.
Diffstat (limited to 'sed')
-rw-r--r-- | sed/compile.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/sed/compile.c b/sed/compile.c index 95ed0aa..4e48c7e 100644 --- a/sed/compile.c +++ b/sed/compile.c @@ -566,7 +566,7 @@ match_slash(slash, regex) else if (ch == 'n' && regex) ch = '\n'; #endif - else if (ch != '\n' && ch != slash) + else if (ch != '\n' && (ch != slash || (!regex && ch == '&'))) add1_buffer(b, '\\'); } else if (ch == OPEN_BRACKET && regex) |