diff options
| author | Eli Zaretskii | 2010-04-08 20:35:10 +0300 |
|---|---|---|
| committer | Eli Zaretskii | 2010-04-08 20:35:10 +0300 |
| commit | 5930fe974d03470d08d0a265bc39b8139c51a198 (patch) | |
| tree | fdb0556b97e0ed6641d9efbe11a03e44e194dd27 /src | |
| parent | 99852628a828979c55c96d7def6c5a21f2b32af5 (diff) | |
| download | emacs-5930fe974d03470d08d0a265bc39b8139c51a198.tar.gz emacs-5930fe974d03470d08d0a265bc39b8139c51a198.zip | |
Fix crash due to incorrect resolution of type of NSM characters (bug#5858).
bidi.c (bidi_resolve_weak): Use prev.type_after_w1, instead of
prev.orig_type, for resolving type of NSM.
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 5 | ||||
| -rw-r--r-- | src/bidi.c | 12 |
2 files changed, 12 insertions, 5 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index 51ed028b9d5..ba7687d7841 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,3 +1,8 @@ | |||
| 1 | 2010-04-08 Eli Zaretskii <eliz@gnu.org> | ||
| 2 | |||
| 3 | * bidi.c (bidi_resolve_weak): Use prev.type_after_w1, instead of | ||
| 4 | prev.orig_type, for resolving type of NSM. (Bug#5858) | ||
| 5 | |||
| 1 | 2010-04-08 Jan Djärv <jan.h.d@swipnet.se> | 6 | 2010-04-08 Jan Djärv <jan.h.d@swipnet.se> |
| 2 | 7 | ||
| 3 | * xsettings.c (current_font, SYSTEM_FONT, XSETTINGS_FONT_NAME): New. | 8 | * xsettings.c (current_font, SYSTEM_FONT, XSETTINGS_FONT_NAME): New. |
diff --git a/src/bidi.c b/src/bidi.c index 7da8cd4a88c..0c8a3182510 100644 --- a/src/bidi.c +++ b/src/bidi.c | |||
| @@ -1347,12 +1347,14 @@ bidi_resolve_weak (struct bidi_it *bidi_it) | |||
| 1347 | if (type == WEAK_NSM) /* W1 */ | 1347 | if (type == WEAK_NSM) /* W1 */ |
| 1348 | { | 1348 | { |
| 1349 | /* Note that we don't need to consider the case where the | 1349 | /* Note that we don't need to consider the case where the |
| 1350 | prev character has its type overridden by an RLO or LRO: | 1350 | prev character has its type overridden by an RLO or LRO, |
| 1351 | such characters are outside the current level run, and | 1351 | because then either the type of this NSM would have been |
| 1352 | thus not relevant to this NSM. Thus, NSM gets the | 1352 | also overridden, or the previous character is outside the |
| 1353 | orig_type of the previous character. */ | 1353 | current level run, and thus not relevant to this NSM. |
| 1354 | This is why NSM gets the type_after_w1 of the previous | ||
| 1355 | character. */ | ||
| 1354 | if (bidi_it->prev.type != UNKNOWN_BT) | 1356 | if (bidi_it->prev.type != UNKNOWN_BT) |
| 1355 | type = bidi_it->prev.orig_type; | 1357 | type = bidi_it->prev.type_after_w1; |
| 1356 | else if (bidi_it->sor == R2L) | 1358 | else if (bidi_it->sor == R2L) |
| 1357 | type = STRONG_R; | 1359 | type = STRONG_R; |
| 1358 | else if (bidi_it->sor == L2R) | 1360 | else if (bidi_it->sor == L2R) |