Re: OpenBSD sed vs GNU sed

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Hugo Villeneuve
Date: Friday, December 25, 2009 - 10:59 am

On Tue, Dec 22, 2009 at 02:32:24AM +0000, Matthew Szudzik wrote:

I should have left more quoted text about tutorial from other sed
implementation. 

I had been using gnu sed for a while and encountered this issue
going with OpenBSD.


I should read better. Since it's documented, it's not a bug.

Of course that sentence is false. ":" correctly interpret semicolon
as next command. "b" and "t" has partial support (only when the
label is not empty). It is true for the a c i r w #.

Is this one of those few case where I should obey the man page
rather than the code?


It's a cute work around. My point is: if a label can't contain
semicolons, why support "tlabel;" and not "t;"? I don't understand
the logic of it.


Don't trust this diff but it make my few test works:

Index: compile.c
===================================================================
RCS file: /cvs/src/usr.bin/sed/compile.c,v
retrieving revision 1.28
diff -u -r1.28 compile.c
--- compile.c	16 Oct 2008 16:34:32 -0000	1.28
+++ compile.c	25 Dec 2009 17:46:49 -0000
@@ -283,7 +283,7 @@
 		case BRANCH:			/* b t */
 			p++;
 			EATSPACE();
-			if (*p == '\0')
+			if (*p == '\0' || *p == ';' )
 				cmd->t = NULL;
 			else
 				cmd->t = duptoeol(p, "branch", &p);
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
vi in /bin, Brad Tilley, (Thu Dec 17, 5:47 pm)
Re: vi in /bin, Randal L. Schwartz, (Thu Dec 17, 6:12 pm)
Re: vi in /bin, Brad Tilley, (Thu Dec 17, 6:23 pm)
Re: vi in /bin, Raymond Lillard, (Thu Dec 17, 8:26 pm)
Re: vi in /bin, David Gwynne, (Thu Dec 17, 10:07 pm)
Re: vi in /bin, Chris Bennett, (Thu Dec 17, 11:09 pm)
Re: vi in /bin, Woodchuck, (Fri Dec 18, 12:35 am)
Re: vi in /bin, Pieter Verberne, (Fri Dec 18, 12:36 am)
Re: vi in /bin, Philip Guenther, (Fri Dec 18, 12:47 am)
Re: vi in /bin, Han Boetes, (Fri Dec 18, 1:07 am)
Re: vi in /bin, Igor Sobrado, (Fri Dec 18, 2:28 am)
Re: vi in /bin, Paul M, (Fri Dec 18, 3:03 am)
Re: vi in /bin, Gregory Edigarov, (Fri Dec 18, 3:15 am)
Re: vi in /bin, Eugene Yunak, (Fri Dec 18, 7:33 am)
Re: vi in /bin, Dale Rahn, (Fri Dec 18, 8:40 am)
Re: vi in /bin, Matthew Szudzik, (Fri Dec 18, 8:46 am)
Re: vi in /bin, Nick Bender, (Fri Dec 18, 9:16 am)
Re: vi in /bin, Internet Retard, (Fri Dec 18, 10:10 am)
Re: vi in /bin, Chris Bennett, (Fri Dec 18, 10:30 am)
Re: vi in /bin, Nick Bender, (Fri Dec 18, 10:55 am)
Re: vi in /bin, ropers, (Fri Dec 18, 11:22 am)
Re: vi in /bin, Chris Bennett, (Fri Dec 18, 11:35 am)
Re: vi in /bin, Matthew Szudzik, (Fri Dec 18, 11:45 am)
Re: vi in /bin, Anders Langworthy, (Fri Dec 18, 12:29 pm)
Re: vi in /bin, Antoine Jacoutot, (Fri Dec 18, 3:57 pm)
Re: vi in /bin, Jason McIntyre, (Fri Dec 18, 4:16 pm)
Re: vi in /bin, Randal L. Schwartz, (Fri Dec 18, 4:27 pm)
Re: vi in /bin, Ingo Schwarze, (Fri Dec 18, 5:33 pm)
Re: vi in /bin, Paul M, (Sat Dec 19, 12:30 am)
Re: vi in /bin, Otto Moerbeek, (Sat Dec 19, 1:30 am)
Re: vi in /bin, Jason McIntyre, (Sat Dec 19, 2:01 am)
Re: vi in /bin, Henning Brauer, (Sat Dec 19, 5:13 am)
Re: vi in /bin, Matthew Szudzik, (Sat Dec 19, 10:34 am)
Re: vi in /bin, Ingo Schwarze, (Sat Dec 19, 10:51 am)
OpenBSD sed vs GNU sed, Hugo Villeneuve, (Mon Dec 21, 6:37 pm)
Re: OpenBSD sed vs GNU sed, Matthew Szudzik, (Mon Dec 21, 7:32 pm)
Re: OpenBSD sed vs GNU sed, Hugo Villeneuve, (Fri Dec 25, 10:59 am)
Re: OpenBSD sed vs GNU sed, Matthew Szudzik, (Fri Dec 25, 11:18 am)