bug-gnu-utils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] uudecode doesn't work on files with DOS line endings


From: Eli Zaretskii
Subject: Re: [PATCH] uudecode doesn't work on files with DOS line endings
Date: Sun, 30 Apr 2006 19:33:37 +0300

> Date: Sun, 30 Apr 2006 09:02:43 -0600
> From: address@hidden (Bob Proulx)
> Cc: address@hidden
> 
> Pavel Roskin wrote:
> > With this patch, uuencoded files with DOS newlines are decoded
> > correctly.
> >    if (fgets (buf, sizeof(buf), stdin) == NULL
> > -      || strcmp (buf, "end\n"))
> > +      || strncmp (buf, "end", 3))
> >      {
> 
> That seems too permissive to me.  How about this?
> 
>   if (fgets (buf, sizeof(buf), stdin) == NULL
>       || strcmp (buf, "end\n")
>       || strcmp (buf, "end\r\n"))
>     {

FWIW, I agree that the latter solution is better (read: less
dangerous).




reply via email to

[Prev in Thread] Current Thread [Next in Thread]