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

List:       busybox
Subject:    Re: [PATCH] awk: GNU extension -e
From:       Denys Vlasenko <vda.linux () googlemail ! com>
Date:       2013-11-21 14:11:56
Message-ID: CAK1hOcOagqYvS1n+LEz3EQD5iXB5EkV7HazsXbe-pYfQeSsABw () mail ! gmail ! com
[Download RAW message or body]

On Thu, Nov 21, 2013 at 12:33 PM, Sven-G=F6ran Bergh
<svengbergh-busybox@yahoo.com> wrote:
> 2013-11-19 12:44:15, Denys Vlasenko <vda.linux@googlemail.com>:
> ...
>>> A new patch with theses changes is attached.
>>
>>Oh, sorry... I committed another patch to git already,
>>which should do what you want. Can you test current git?
>>Let me know if it still needs something.
>
> Sorry Denys, but the current git is a regression.
> For ex try:
>
>
> $ echo "{print $2;}" > test.awk
> $ echo "do re mi" > test.txt
> $ busybox awk -f test.awk test.txt
> ^C
> $ busybox awk -e '{print $2;}' test.txt
> ^C
>
> $
>
>
> It does not see the input file, so it hangs waiting for
> an input.
>
> Try my last patch, or based on the current git:
>
>                 parse_program(llist_pop(&list_e));
>         }
>  #endif
> -       if (!(opt & (OPT_f | OPT_e))) {
> +       if (opt & (OPT_f | OPT_e)) {
> +               argc++;
> +       } else { // no -f nor -e: take program from 1st parameter
>                 if (!*argv)
>                         bb_show_usage();
>                 parse_program(*argv++);
> -               argc++;
>         }
>         if (opt & OPT_W) // -W
>                 bb_error_msg("warning: option -W is ignored");

Applied with a small change (hopefully one jump less)
and added two testcases to cover it.

-- =

vda
_______________________________________________
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