Bug 5522 - sed: jumps are not handled correctly inside command groups
Summary: sed: jumps are not handled correctly inside command groups
Status: NEW
Alias: None
Product: Busybox
Classification: Unclassified
Component: Standard Compliance (show other bugs)
Version: 1.19.x
Hardware: Other Linux
: P5 normal
Target Milestone: ---
Assignee: unassigned
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-09-13 22:47 UTC by steffen1956
Modified: 2012-09-13 22:47 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description steffen1956 2012-09-13 22:47:42 UTC
Hi!

BusyBox' sed has problems when a command ground "{...}" ends with a jump statement "b". I tried the following examples both in my local BusyBox 1.19.4 and in the VM (http://busybox.net/live_bbox/live_bbox.html) with version 1.20.0. Both examples work without any problems when executed by GNU sed.

example 1 (jump with label)
---------------------------
/ # echo 'a                                                                     
> b                                                                             
> c                                                                             
> d' | sed -ne ':a /^b/ {n;p;b a}'                                              
sed: unterminated {


example 2 (jump w/o label)
--------------------------
/ # echo 'a                                                                     
> b                                                                             
> c                                                                             
> d' | sed -ne '/^b/ {x;p;b}' -e 'h'                                            
sed: unterminated {


Adding a semicolon before the closing brace is a workaround in both cases.

/ # echo 'a                                                                     
> b                                                                             
> c                                                                             
> d' | sed -ne '/^b/ {x;p;b;}' -e 'h'
a