1
0
Fork 0
mirror of git://git.code.sf.net/p/cdesktopenv/code synced 2025-02-15 04:32:24 +00:00

On linux use \r instead of ^M as the character for a carridge return.

This commit is contained in:
Peter Howkins 2012-04-02 15:13:13 +01:00
parent 5c6f7d5317
commit 8f43a96122

View file

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