A dirty tac shrink (-267 bytes)

Denys Vlasenko vda.linux at googlemail.com
Mon Jun 13 01:58:22 UTC 2011


On Tuesday 03 May 2011 10:28, Pascal Bellard wrote:
>    text    data     bss     dec     hex filename
>     317       0       0     317     13d busybox.org/coreutils/tac.o
>      40       0       0      40      28 busybox/coreutils/tac.o
> --- busybox.org/coreutils/tac.c Tue May  3 00:52:22 2011
> +++ busybox/coreutils/tac.c     Tue May  3 10:11:07 2011
> @@ -33,6 +33,10 @@
>  int tac_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
>  int tac_main(int argc UNUSED_PARAM, char **argv)
>  {
> +#ifdef CONFIG_SED
> +       argv[0] = "1!G;h;$!d";
> +       return sed_main(0, --argv);
> +#else
>         char **name;
>         FILE *f;
>         struct lstring *line = NULL;

Doesn't work if you have more than one file on command line.

-- 
vda


More information about the busybox mailing list