Re: [PATCH] Support DOS line endings

From: Matthew Wilcox
Date: Thu Jul 13 2006 - 16:00:34 EST


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;
}
-
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/