lkml.org 
[lkml]   [2006]   [Jul]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] Support DOS line endings
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@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2006-07-13 22:05    [W:0.016 / U:1.828 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site