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);