[BusyBox] Sourcein command fails in sh SOLVED

Mark Whitley markw at lineo.com
Mon Apr 23 17:08:21 UTC 2001


On Sat, Apr 21, 2001 at 05:23:11PM +0200, Heinz Walter wrote:
> Hello, I've solved the problem below.
> 
> The fault is in trim() in utility.c.
> Below is the patch.
> 
> 
> -----------------------------
> diff -Naur busybox/utility.c busybox-0.50/utility.c
> --- busybox/utility.c   Wed Mar 14 01:43:16 2001
> +++ busybox-0.50/utility.c      Sat Apr 21 15:49:24 2001
> @@ -1849,6 +1849,8 @@
>  #if defined(BB_SH)
>  void trim(char *s)
>  {
> +       if(!*s)
> +               return;
>         /* trim trailing whitespace */
>         while (isspace(s[strlen(s)-1]))
>                 s[strlen(s)-1]='\0';                                        
>          
> -----------------------------

I just added something like this to trim.c. Thanks for spotting this. Check
out the CVS code and let me know if you have any problems.

Mark Whitley
markw at lineo.com





More information about the busybox mailing list