Re: Importing Mozilla CVS into git

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

 



On 6/4/06, Linus Torvalds <torvalds@xxxxxxxx> wrote:
+static unsigned long autodetect_crlf(unsigned char *src, unsigned long size)
+{
+       unsigned long newsize = 0;
+       unsigned char *dst = src;
+       unsigned char last = 0;
+
+       while (size) {
+               unsigned char c = *src++;

size--;
is missing

+               if (last == '\r' && c == '\n') {
+                       dst[-1] = '\n';
+               } else {
+                       newsize++;
+                       dst++;
+                       if (dst != src)
+                               dst[-1] = c;
+               }
+               last = c;
+       }
+       return newsize;
+}

Yakov
-
: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]