On Sat, Jun 18, 2011 at 3:31 PM, Ingo Schwarze schwa...@usta.de wrote:
Hi Otto,
from careful code inspection, your patch looks correct.
Replacing the by = is wrong, it would breaks this test case:
echo abc | ./obj/sed -E 's/(b|())/x/g'
However, the code is hard to follow, and i suggest
Hello,
looks like it worked,
but what about this diff,just adding the new when rm_so is 0 (how to run the
regression test ?):
Index: process.c
===
RCS file: /cvs/src/usr.bin/sed/process.c,v
retrieving revision 1.15
diff -r1.15
Hi Sven,
but what about this diff,
1) Please use diff -up.
2) It doesn't apply to my tree.
If i understand your intention correctly, that is, replacing
the } else { by just } and doing the content of the else
clause unconditionally, that's plain wrong. It makes sed
miss one out of two
Hi Otto,
from careful code inspection, your patch looks correct.
Replacing the by = is wrong, it would breaks this test case:
echo abc | ./obj/sed -E 's/(b|())/x/g'
However, the code is hard to follow, and i suggest the following
refactoring such that people doing a review can more easily
Hello,
Well, i failed to apply your second patch :s (patch ./process.c ./yourdiff)
doing it manually (twice), it pass test but does not correct the initial
problem.
# echo 'aba' | sed -E 's/a|$/x/g'
xbx
Maybe i'm wrong ?
Nevertheless, my attempt is not that much better, it destroy the leading
Good for me:
Index: process.c
===
RCS file: /cvs/src/usr.bin/sed/process.c,v
retrieving revision 1.15
diff -u -p -r1.15 process.c
--- process.c 27 Oct 2009 23:59:43 - 1.15
+++ process.c 18 Jun 2011 21:04:39 -
@@
not that good :'(
# echo -n 'aba' | sed -E 's/a|$/x/g'
xbx#
#
2011/6/18 sven falempin sven.falem...@gmail.com
Good for me:
Index: process.c
===
RCS file: /cvs/src/usr.bin/sed/process.c,v
retrieving revision 1.15
diff -u -p
the diff, sorry for spaming, last send diff was bad:
Index: process.c
===
RCS file: /cvs/src/usr.bin/sed/process.c,v
retrieving revision 1.15
diff -u -p -r1.15 process.c
--- process.c 27 Oct 2009 23:59:43 - 1.15
+++
On Wed, Jun 15, 2011 at 07:44:20AM +0200, Otto Moerbeek wrote:
On Tue, Jun 14, 2011 at 11:56:27PM +0200, sven falempin wrote:
Hello,
Indeed there is a small problem:
# echo 'abf' | sed -E 's/[a$]/x/g'
xbf
That is expected. $ is only special when
On 06/15/11 08:35, Otto Moerbeek wrote:
On Wed, Jun 15, 2011 at 07:44:20AM +0200, Otto Moerbeek wrote:
On Tue, Jun 14, 2011 at 11:56:27PM +0200, sven falempin wrote:
Hello,
Indeed there is a small problem:
# echo 'abf' | sed -E 's/[a$]/x/g'
xbf
That is
On 06/15/11 08:58, Alexander Hall wrote:
On 06/15/11 08:35, Otto Moerbeek wrote:
On Wed, Jun 15, 2011 at 07:44:20AM +0200, Otto Moerbeek wrote:
On Tue, Jun 14, 2011 at 11:56:27PM +0200, sven falempin wrote:
Hello,
Indeed there is a small problem:
# echo 'abf' | sed -E
On 06/15/11 08:35, Otto Moerbeek wrote:
On Wed, Jun 15, 2011 at 07:44:20AM +0200, Otto Moerbeek wrote:
On Tue, Jun 14, 2011 at 11:56:27PM +0200, sven falempin wrote:
Hello,
Indeed there is a small problem:
# echo 'abf' | sed -E 's/[a$]/x/g'
xbf
That is
Hi,
So what 'sed' shall do when match[0].rm_so i==0 ?
Regards.
2011/6/15 Alexander Hall ha...@openbsd.org
On 06/15/11 08:35, Otto Moerbeek wrote:
On Wed, Jun 15, 2011 at 07:44:20AM +0200, Otto Moerbeek wrote:
On Tue, Jun 14, 2011 at 11:56:27PM +0200, sven falempin wrote:
Hello,
On Wed, Jun 15, 2011 at 09:50:29AM +0200, Alexander Hall wrote:
On 06/15/11 08:35, Otto Moerbeek wrote:
On Wed, Jun 15, 2011 at 07:44:20AM +0200, Otto Moerbeek wrote:
On Tue, Jun 14, 2011 at 11:56:27PM +0200, sven falempin wrote:
Hello,
Indeed there is a small problem:
# echo
On Wed, Jun 15, 2011 at 12:02:44PM +0200, sven falempin wrote:
Hi,
So what 'sed' shall do when match[0].rm_so i==0 ?
lastempty is true in that case.
-Otto
On Wed, Jun 15, 2011 at 12:17:09PM +0200, Otto Moerbeek wrote:
It differs from perl like this:
$ echo 'l1_1' | perl -pe 's/1|$/X/g'
lX_XX
$ echo 'l1_1' | sed -E 's/1|$/X/g'
lX_X
Meaning we don't hit that final '$' if the last match went to eol.
/Alexander
Right.
I
FWIW GNU sed also appears to have the same behaviour (different from
perl).
On Wed, Jun 15, 2011 at 12:26:39PM +0200, Otto Moerbeek wrote:
On Wed, Jun 15, 2011 at 12:17:09PM +0200, Otto Moerbeek wrote:
It differs from perl like this:
$ echo 'l1_1' | perl -pe 's/1|$/X/g'
lX_XX
On 2011-06-15, Alexander Hall ha...@openbsd.org wrote:
This dif fixes your problem here. Big question is of course: does it
break other cases?
It differs from perl like this:
$ echo 'l1_1' | perl -pe 's/1|$/X/g'
lX_XX
$ echo 'l1_1' | sed -E 's/1|$/X/g'
lX_X
Meaning we don't hit that
On Wed, Jun 15, 2011 at 7:17 AM, Otto Moerbeek o...@drijf.net wrote:
On Wed, Jun 15, 2011 at 09:50:29AM +0200, Alexander Hall wrote:
On 06/15/11 08:35, Otto Moerbeek wrote:
On Wed, Jun 15, 2011 at 07:44:20AM +0200, Otto Moerbeek wrote:
On Tue, Jun 14, 2011 at 11:56:27PM +0200, sven
On Wed, Jun 15, 2011 at 11:41:51PM -0300, pablo caballero wrote:
On Wed, Jun 15, 2011 at 7:17 AM, Otto Moerbeek o...@drijf.net wrote:
On Wed, Jun 15, 2011 at 09:50:29AM +0200, Alexander Hall wrote:
On 06/15/11 08:35, Otto Moerbeek wrote:
On Wed, Jun 15, 2011 at 07:44:20AM +0200, Otto
Hello,
Indeed there is a small problem:
# echo 'abf' | sed -E 's/[a$]/x/g'
xbf
# echo 'abf' | sed -E 's/a|$/x/g'
x
String modification is done inside the 'case 0:'
substitute(struct s_command *cp) in src/usr.bin/process.c
But the problem may
On Tue, Jun 14, 2011 at 11:56:27PM +0200, sven falempin wrote:
Hello,
Indeed there is a small problem:
# echo 'abf' | sed -E 's/[a$]/x/g'
xbf
That is expected. $ is only special when it ocurs as the list char of
a re.
# echo 'abf' | sed
Hello list,
I have an issue with sed. Why does
echo 'ab' | sed -E 's/a|$/x/g'
give 'x' whereas
echo 'ab' | perl -e 'my $var = ; $var =~ s/a|$/x/g; print $var'
and GNU's sed yield 'xbx' (which I expected to be the result in the
first case)?
Thanks
Nils
Hi Nils,
Nils Anspach wrote on Sun, Jun 12, 2011 at 12:49:42PM +0200:
I have an issue with sed. Why does
echo 'ab' | sed -E 's/a|$/x/g'
give 'x' whereas
I sense a bug here.
Tracing a bit around process(),
it looks like the first application of the s command
yields dst = x
24 matches
Mail list logo