[BusyBox] PATCH for crond EOL bug

Pauli Saksa psaksa at cc.hut.fi
Wed Jul 20 09:49:43 UTC 2005


On Mon, 18 Jul 2005 20:35:32 +0400 "Vladimir N. Oleynik" <dzo at simtreas.ru> wrote:

> > void trim(char *s)
> > {
> >         size_t len = strlen(s);
> >         size_t lws;
> > 
> >         /* trim trailing whitespace */
> >         while ( len > 0 && isspace(s[len-1]))
> >                 --len;
> > 
> >         /* trim leading whitespace */
> +	  if(len > 0) {
> >         lws = strspn(s, " \n\r\t\v");
> >         len -= lws;
> >         memmove(s, s + lws, len);
> +	  }
> >         s[len] = 0;
> > }
> > 
> > 
> > is perfect?

yeah this looks right.

I took the liberty to form a new patch combining the previous patch,
this fix to trim and a tiny issue of incorrect file mode I noticed
also in crond.

So, ignore the previous patch, more complete patch attached.

-- 
Pauli Saksa
psaksa at cc.hut.fi
-------------- next part --------------
A non-text attachment was scrubbed...
Name: busybox-1.00-p03-crond.patch
Type: application/octet-stream
Size: 1364 bytes
Desc: not available
Url : http://lists.busybox.net/pipermail/busybox/attachments/20050720/96b4a994/attachment.obj 


More information about the busybox mailing list