[BusyBox 0000615]: sed convert 0x00 to 0x0a

bugs at busybox.net bugs at busybox.net
Wed Dec 28 11:18:17 UTC 2005


A NOTE has been added to this issue. 
====================================================================== 
http://busybox.net/bugs/view.php?id=615 
====================================================================== 
Reported By:                robang74
Assigned To:                BusyBox
====================================================================== 
Project:                    BusyBox
Issue ID:                   615
Category:                   Other
Reproducibility:            always
Severity:                   major
Priority:                   normal
Status:                     assigned
====================================================================== 
Date Submitted:             12-28-2005 01:26 PST
Last Modified:              12-28-2005 03:18 PST
====================================================================== 
Summary:                    sed convert 0x00 to 0x0a
Description: 
bash-3.00# dd if=/dev/zero bs=1k count=1 >/tmp/test
1+0 records in
1+0 records out
bash-3.00# echo ciao>>/tmp/test
bash-3.00# dd if=/dev/zero bs=1k count=1 >>/tmp/test
1+0 records in
1+0 records out
bash-3.00# cat /tmp/test | sed -e "s/ciao/miao/g" >/tmp/test2
bash-3.00# wc -l /tmp/test
      1 /tmp/test
bash-3.00# wc -l /tmp/test2
   2048 /tmp/test2
====================================================================== 

---------------------------------------------------------------------- 
 robang74 - 12-28-05 03:18  
---------------------------------------------------------------------- 
sed loose the last 0x00 if it exist:

bash-3.00# ls -al /tmp/test*
-rw-r--r--    1 0        0            2053 Dec 28 11:16 /tmp/test
-rw-r--r--    1 0        0            2052 Dec 28 11:16 /tmp/test2


AFTER PATCH:

/ # dd if=/dev/zero bs=1k count=1 >/tmp/test
1+0 records in
1+0 records out
/ # echo ciao>>/tmp/test
/ # dd if=/dev/zero bs=1k count=1 >>/tmp/test
1+0 records in
1+0 records out
/ # cat /tmp/test | sed -e "s/ciao/miao/g" >/tmp/test2
/ # wc -l /tmp/test2
      1 /tmp/test2
/ # wc -l /tmp/test
      1 /tmp/test
/ # ls -al /tmp/test*
-rw-r--r--    1 0        0            2053 Dec 28 11:17 /tmp/test
-rw-r--r--    1 0        0            2053 Dec 28 11:17 /tmp/test2 

Issue History 
Date Modified   Username       Field                    Change               
====================================================================== 
12-28-05 01:26  robang74       New Issue                                    
12-28-05 01:26  robang74       Status                   new => assigned     
12-28-05 01:26  robang74       Assigned To               => BusyBox         
12-28-05 01:26  robang74       Issue Monitored: robang74                    
12-28-05 03:18  robang74       Note Added: 0000821                          
======================================================================




More information about the busybox-cvs mailing list