| | @@ -407,10 +407,20 @@ |
| 407 | 407 | */ |
| 408 | 408 | rc = system(zOrigCmd); |
| 409 | 409 | #endif |
| 410 | 410 | return rc; |
| 411 | 411 | } |
| 412 | + |
| 413 | +/* |
| 414 | +** Turn off any NL to CRNL translation on the stream given as an |
| 415 | +** argument. This is a no-op on unix but is necessary on windows. |
| 416 | +*/ |
| 417 | +void fossil_binary_mode(FILE *p){ |
| 418 | +#if defined(_WIN32) |
| 419 | + _setmode(_fileno(p), _O_BINARY); |
| 420 | +#endif |
| 421 | +} |
| 412 | 422 | |
| 413 | 423 | |
| 414 | 424 | |
| 415 | 425 | /* |
| 416 | 426 | ** Return a name for an SQLite error code |
| 417 | 427 | |