aboutsummaryrefslogtreecommitdiffstats
path: root/src/bidi.c
diff options
context:
space:
mode:
authorEli Zaretskii2011-08-06 13:59:36 +0300
committerEli Zaretskii2011-08-06 13:59:36 +0300
commitd1410150345acdf2d7693fe00b8169312fe40d14 (patch)
treeaccd9d7c414485e00d9fe30e1d1c28c7e3ea5c60 /src/bidi.c
parentd747b53feb3e403571c724cc5add1e5e354f4408 (diff)
downloademacs-d1410150345acdf2d7693fe00b8169312fe40d14.tar.gz
emacs-d1410150345acdf2d7693fe00b8169312fe40d14.zip
Fix bug #9254 with crash and cursor positioning under longlines-mode.
src/xdisp.c (set_cursor_from_row): Fix cursor positioning when a display property strides EOL and includes a newline, as in longlines-mode. src/bidi.c (bidi_unshelve_cache): Don't reset the cache if JUST_FREE is non-zero, even if the data buffer is NULL. Fixes a crash in vertical-motion with longlines-mode.
Diffstat (limited to 'src/bidi.c')
-rw-r--r--src/bidi.c17
1 files changed, 12 insertions, 5 deletions
diff --git a/src/bidi.c b/src/bidi.c
index 0db144bea6c..2879198ce31 100644
--- a/src/bidi.c
+++ b/src/bidi.c
@@ -666,7 +666,11 @@ bidi_shelve_cache (void)
666 return databuf; 666 return databuf;
667} 667}
668 668
669/* Restore the cache state from a copy stashed away by bidi_shelve_cache. */ 669/* Restore the cache state from a copy stashed away by
670 bidi_shelve_cache, and free the buffer used to stash that copy.
671 JUST_FREE non-zero means free the buffer, but don't restore the
672 cache; used when the corresponding iterator is discarded instead of
673 being restored. */
670void 674void
671bidi_unshelve_cache (void *databuf, int just_free) 675bidi_unshelve_cache (void *databuf, int just_free)
672{ 676{
@@ -674,10 +678,13 @@ bidi_unshelve_cache (void *databuf, int just_free)
674 678
675 if (!p) 679 if (!p)
676 { 680 {
677 /* A NULL pointer means an empty cache. */ 681 if (!just_free)
678 bidi_cache_start = 0; 682 {
679 bidi_cache_sp = 0; 683 /* A NULL pointer means an empty cache. */
680 bidi_cache_reset (); 684 bidi_cache_start = 0;
685 bidi_cache_sp = 0;
686 bidi_cache_reset ();
687 }
681 } 688 }
682 else 689 else
683 { 690 {