On linux use \r instead of ^M as the character for a carridge return.
This commit is contained in:
@@ -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 == '
|
if (*ptr == '
|
||||||
|
' && *(ptr+1) == '\n')
|
||||||
#endif
|
#endif
|
||||||
continue;
|
continue;
|
||||||
writebuf[j++] = *ptr;
|
writebuf[j++] = *ptr;
|
||||||
|
|||||||
Reference in New Issue
Block a user