Re: [PATCH] Support DOS line endings

From: Sam Ravnborg
Date: Thu Jul 13 2006 - 17:05:35 EST


On Thu, Jul 13, 2006 at 02:02:23PM -0600, Matthew Wilcox wrote:
> On Thu, Jul 13, 2006 at 09:35:43PM +0200, Sam Ravnborg wrote:
> > --- a/scripts/kconfig/confdata.c
> > +++ b/scripts/kconfig/confdata.c
> > @@ -195,6 +195,8 @@ load:
> > p2 = strchr(p, '\n');
> > if (p2)
> > *p2 = 0;
> > + if (*--p2 == '\r')
> > + *p2 = 0;
>
> ... but if p2 is NULL ...
>
> so:
> if (p2) {
> *p2 = 0;
> if (*--p2 == '\r')
> *p2 = 0;
> }
>
> but maybe it'd be better to do ...
>
> if (p2) {
> *p2-- = 0;
> if (*p2 == '\r')
> *p2 = 0;
> }
Thanks. Maybe I should just stop trying to code anything today ;-)

Sam
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/