diff options
Diffstat (limited to 'src/charset.h')
| -rw-r--r-- | src/charset.h | 17 |
1 files changed, 3 insertions, 14 deletions
diff --git a/src/charset.h b/src/charset.h index 6b2e25b89dd..3acc447c5f8 100644 --- a/src/charset.h +++ b/src/charset.h | |||
| @@ -577,26 +577,15 @@ else | |||
| 577 | ? 1 \ | 577 | ? 1 \ |
| 578 | : multibyte_form_length (str, len)) | 578 | : multibyte_form_length (str, len)) |
| 579 | 579 | ||
| 580 | /* Set C a (possibly multibyte) character at P. P points into a | ||
| 581 | string which is the virtual concatenation of STR1 (which ends at | ||
| 582 | END1) or STR2 (which ends at END2). */ | ||
| 583 | |||
| 584 | #define GET_CHAR_AFTER_2(c, p, str1, end1, str2, end2) \ | ||
| 585 | do { \ | ||
| 586 | const char *dtemp = (p) == (end1) ? (str2) : (p); \ | ||
| 587 | const char *dlimit = ((p) >= (str1) && (p) < (end1)) ? (end1) : (end2); \ | ||
| 588 | c = STRING_CHAR (dtemp, dlimit - dtemp); \ | ||
| 589 | } while (0) | ||
| 590 | |||
| 591 | /* Set C a (possibly multibyte) character before P. P points into a | 580 | /* Set C a (possibly multibyte) character before P. P points into a |
| 592 | string which is the virtual concatenation of STR1 (which ends at | 581 | string which is the virtual concatenation of STR1 (which ends at |
| 593 | END1) or STR2 (which ends at END2). */ | 582 | END1) or STR2 (which ends at END2). */ |
| 594 | 583 | ||
| 595 | #define GET_CHAR_BEFORE_2(c, p, str1, end1, str2, end2) \ | 584 | #define GET_CHAR_BEFORE_2(c, p, str1, end1, str2, end2) \ |
| 596 | do { \ | 585 | do { \ |
| 597 | const char *dtemp = (p); \ | 586 | const unsigned char *dtemp = (p); \ |
| 598 | const char *dlimit = ((p) > (str2) && (p) <= (end2)) ? (str2) : (str1); \ | 587 | const unsigned char *dlimit = ((p) > (str2) && (p) <= (end2)) ? (str2) : (str1); \ |
| 599 | while (dtemp-- > dlimit && (unsigned char) *dtemp >= 0xA0); \ | 588 | while (dtemp-- > dlimit && *dtemp >= 0xA0); \ |
| 600 | c = STRING_CHAR (dtemp, p - dtemp); \ | 589 | c = STRING_CHAR (dtemp, p - dtemp); \ |
| 601 | } while (0) | 590 | } while (0) |
| 602 | 591 | ||