/* text mode */
if (_rbyte && istext)
{
+ int found_cr = 0;
int cr = 0;
DWORD count = _rbyte;
/* repeat for all bytes in the buffer */
for(; count; bufp++, count--)
{
+#if 1
+ /* carriage return */
+ if (*bufp == '\r') {
+ found_cr = 1;
+ if (cr != 0) {
+ *(bufp - cr) = *bufp;
+ }
+ continue;
+ }
+ if (found_cr) {
+ found_cr = 0;
+ if (*bufp == '\n') {
+ cr++;
+ *(bufp - cr) = *bufp;
+ } else {
+ }
+ } else if (cr != 0) {
+ *(bufp - cr) = *bufp;
+ }
+#else
/* carriage return */
- if (*bufp == '\r')
+ if (*bufp == '\r') {
cr++;
+ }
/* shift characters back, to ignore carriage returns */
- else if (cr != 0)
+ else if (cr != 0) {
*(bufp - cr) = *bufp;
-
+ }
+#endif
+ }
+ if (found_cr) {
+ cr++;
}
-
/* ignore the carriage returns */
_rbyte -= cr;
}
-
DPRINT("%d\n", _rbyte);
return _rbyte;
}