Changeset 3621:1116ed42fa23
- Timestamp:
- 2004-02-08 03:41:31 (5 years ago)
- Author:
- Edmund GRIMLEY EVANS <edmundo@…>
- Branch:
- HEAD
- Message:
-
Fix a CP1255/8-related problem that's caused by a glibc/iconv bug.
- Files:
-
Legend:
- Unmodified
- Added
- Removed
-
|
r3179
|
r3621
|
|
| 380 | 380 | continue; |
| 381 | 381 | } |
| 382 | | if (outrepl) |
| | 382 | /* Replace the output */ |
| | 383 | if (!outrepl) |
| | 384 | outrepl = "?"; |
| | 385 | iconv (cd, 0, 0, &ob, &obl); |
| | 386 | if (obl) |
| 383 | 387 | { |
| 384 | | /* Try replacing the output */ |
| 385 | 388 | int n = strlen (outrepl); |
| 386 | | if (n <= obl) |
| | 389 | if (n > obl) |
| 387 | 390 | { |
| 388 | | memcpy (ob, outrepl, n); |
| 389 | | ++ib, --ibl; |
| 390 | | ob += n, obl -= n; |
| 391 | | ++ret; |
| 392 | | continue; |
| | 391 | outrepl = "?"; |
| | 392 | n = 1; |
| 393 | 393 | } |
| | 394 | memcpy (ob, outrepl, n); |
| | 395 | ++ib, --ibl; |
| | 396 | ob += n, obl -= n; |
| | 397 | ++ret; |
| | 398 | iconv (cd, 0, 0, 0, 0); /* for good measure */ |
| | 399 | continue; |
| 394 | 400 | } |
| 395 | 401 | } |