Re: [PATCH] Support DOS line endings

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

 



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 [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux