On linux use \r instead of ^M as the character for a carridge return.
authorPeter Howkins <flibble@users.sourceforge.net>
Mon, 2 Apr 2012 14:13:13 +0000 (15:13 +0100)
committerPeter Howkins <flibble@users.sourceforge.net>
Mon, 2 Apr 2012 14:13:13 +0000 (15:13 +0100)
cde/programs/dtmail/libDtMail/Common/IO.C

index 2677dcf5d1374f47664af5738756656db1a7f3f3..87f6446ac743b8a29261fdfc0676c2bd183efde4 100644 (file)
@@ -306,7 +306,11 @@ SafeWriteStrip(int fd, const void * buf, size_t bytes)
     writebuf = (char*) malloc(bytes < SWS_BUFFERSIZE ? bytes : SWS_BUFFERSIZE); 
 
     for (i = 0, j = 0; i < bytes; i++, ptr++) {
+#if defined(linux)
+       if (*ptr == '\r' && *(ptr+1) == '\n')
+#else
        if (*ptr == '\r' && *(ptr+1) == '\n')
+#endif
                continue;
        writebuf[j++] = *ptr;
        if (j == SWS_BUFFERSIZE || i == (bytes-1)) {