aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorEli Zaretskii2016-06-28 19:03:43 +0300
committerEli Zaretskii2016-06-28 19:03:43 +0300
commit0644e6f56d2be82dd716478eb65e7b3c761d813d (patch)
treed9af29e359d325204273d004a98175cc4fd07710 /src
parentcfb3c61f1ffec9a6322407fdd228d5cc31c31ed0 (diff)
downloademacs-0644e6f56d2be82dd716478eb65e7b3c761d813d.tar.gz
emacs-0644e6f56d2be82dd716478eb65e7b3c761d813d.zip
Fix copying properties in 'format' when it produces padding
* src/textprop.c (extend_property_ranges): Correct range extension when the new end is beyond the old end. (Bug#23859)
Diffstat (limited to 'src')
-rw-r--r--src/textprop.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/textprop.c b/src/textprop.c
index c4e49d98ebc..aabd5671e76 100644
--- a/src/textprop.c
+++ b/src/textprop.c
@@ -2065,9 +2065,14 @@ extend_property_ranges (Lisp_Object list, Lisp_Object new_end)
2065 else 2065 else
2066 XSETCDR (prev, XCDR (list)); 2066 XSETCDR (prev, XCDR (list));
2067 } 2067 }
2068 else if (XINT (end) > max) 2068 else if (XINT (end) != max)
2069 /* The end-point is past the end of the new string. */ 2069 {
2070 XSETCAR (XCDR (item), new_end); 2070 /* Either the end-point is past the end of the new string,
2071 and we need to discard the properties past the new end,
2072 or the caller is extending the property range, and we
2073 should update the end-point to reflect that. */
2074 XSETCAR (XCDR (item), new_end);
2075 }
2071 } 2076 }
2072 2077
2073 return head; 2078 return head;