]> code.delx.au - gnu-emacs/blobdiff - src/textprop.c
Fix an error in Tramp for rsync
[gnu-emacs] / src / textprop.c
index c4e49d98ebc47efc5576758048ca62bf18f1411b..aabd5671e76035a5b0cc919119d0e9c911d6dfb0 100644 (file)
@@ -2065,9 +2065,14 @@ extend_property_ranges (Lisp_Object list, Lisp_Object new_end)
          else
            XSETCDR (prev, XCDR (list));
        }
-      else if (XINT (end) > max)
-       /* The end-point is past the end of the new string.  */
-       XSETCAR (XCDR (item), new_end);
+      else if (XINT (end) != max)
+       {
+         /* Either the end-point is past the end of the new string,
+            and we need to discard the properties past the new end,
+            or the caller is extending the property range, and we
+            should update the end-point to reflect that.  */
+         XSETCAR (XCDR (item), new_end);
+       }
     }
 
   return head;