[prev in list] [next in list] [prev in thread] [next in thread] 

List:       busybox
Subject:    Re: BusyBox sed 'w' loses data on occasion
From:       Denys Vlasenko <vda.linux () googlemail ! com>
Date:       2022-01-04 18:43:31
Message-ID: CAK1hOcPtTMDqLDGoZZLdpJ1toNFfOG5+xd7OyV-CAVukE+80CQ () mail ! gmail ! com
[Download RAW message or body]

Fixed in git.

On Sun, Jan 2, 2022 at 2:49 AM Paul Eggert <eggert@cs.ucla.edu> wrote:
>
> This bug in BusyBox 'sed' broke a Gnulib-based build; see
> <https://lists.gnu.org/r/bug-gnulib/2022-01/msg00004.html>.
>
> The problem is that BusyBox 'sed' is confused about the 'w FILE'
> command. When there are multiple 'w FILE' commands (or 's/.../.../w
> FILE' commands) it opens FILE multiple times. This can lose data
> intended for FILE. Here is a simple shell transcript illustrating the
> problem:
>
> $ printf 'a\nb\n' | busybox sed -n -e '/a/w xxx' -e '/b/w xxx'
> $ cat xxx
> a
>
> The output should be:
>
> a
> b
> _______________________________________________
> busybox mailing list
> busybox@busybox.net
> http://lists.busybox.net/mailman/listinfo/busybox
_______________________________________________
busybox mailing list
busybox@busybox.net
http://lists.busybox.net/mailman/listinfo/busybox
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic