Re: Importing Mozilla CVS into git
- From
- Yakov Lerner <iler.ml@gmail.com>
- Date
- Jun 5, 2006, 00:10 UTC
- Message-ID
- <f36b08ee0606041710r695924cdgaea7822d987ebe94@mail.gmail.com>
- In-Reply-To
- <Pine.LNX.4.64.0606031631480.5498@g5.osdl.org>
On 6/4/06, Linus Torvalds <torvalds@osdl.org> wrote: +static unsigned long autodetect_crlf(unsigned char *src, unsigned long size)
Show 7 quoted lines
> +{
> + unsigned long newsize = 0;
> + unsigned char *dst = src;
> + unsigned char last = 0;
> +
> + while (size) {
> + unsigned char c = *src++;size--; is missing
Show 12 quoted lines
> + if (last == '\r' && c == '\n') {
> + dst[-1] = '\n';
> + } else {
> + newsize++;
> + dst++;
> + if (dst != src)
> + dst[-1] = c;
> + }
> + last = c;
> + }
> + return newsize;
> +}Yakov