On Sunday 15 March 2009 16:47, walter harms wrote:
> > Try attached patch, it fixes all these problems in my testing.
> 
> I have tested the patch and it seems to work ok.
>  [:xdigit:] seems to work
> 
> While testing i noticed that  tr -dc [z-A] behaver differs from GNU tr
> 
> GNU:
> tr -dc [z-A]
> tr: range-endpoints of `z-A' are in reverse collating sequence order
> 
> 
> therefor i suggest a patch like that:
> 
> --- coreutils/tr.c.org  2009-03-15 16:07:41.000000000 +0100
> +++ coreutils/tr.c      2009-03-15 16:14:06.000000000 +0100
> @@ -62,6 +62,9 @@
>                                 continue; /* next iter will copy '-' and stop 
> */
>                         }
>                         i = *arg;
> +                       if (arg[0]>arg[3])

arg is "const char *arg". Bug above if char type is signed.
Also, I suspect no one has scripts which depend on
that "tr z-A" fails, that would be strange.

> +                         bb_error_msg_and_die("Endpoints in reverse order");
> +
>                         while (i <= ac) /* ok: i is unsigned _int_ */
>                                 *buffer++ = i++;
>                         arg += 3; /* skip 0-9 */

--
vda
_______________________________________________
busybox mailing list
[email protected]
http://lists.busybox.net/mailman/listinfo/busybox

Reply via email to