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

List:       busybox
Subject:    Re: sed.tests failed
From:       Denys Vlasenko <vda.linux () googlemail ! com>
Date:       2016-08-26 15:57:10
Message-ID: CAK1hOcPq+a33BubPdM=3wJczUdRFMjYGCEt5WrQ8PFLT6=sRnw () mail ! gmail ! com
[Download RAW message or body]

On Thu, Aug 25, 2016 at 5:29 AM, dengke.du@windriver.com
<dengke.du@windriver.com> wrote:
> Hi all
>
> When I test the busybox testsuite sed.tests. The test case:
>
>         sed n (flushes pattern space, terminates early) failed
>
> Should we need to discuss how does the busybox'sed interact with no newline
> at EOF?

Relevant sed.tests fragment:

test x"$SKIP_KNOWN_BUGS" = x"" && {
# Normal sed end-of-script doesn't print "c" because n flushed the pattern
# space.  If n hits EOF, pattern space is empty when script ends.
# Query: how does this interact with no newline at EOF?
testing "sed n (flushes pattern space, terminates early)" "sed -e 'n;p'" \
        "a\nb\nb\nc\n" "" "a\nb\nc\n"
}

Yes, it is a known bug in our sed:

$ echo -ne "a\nb\nc\n" | sed -e 'n;p'
a
b
b
c

$ echo -ne "a\nb\nc\n" | ./busybox sed -e 'n;p'
a
b
b
c
c

Nobody's working on it yet. Feel free to propose a patch.
_______________________________________________
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