]> code.delx.au - gnu-emacs/blobdiff - src/textprop.c
Fix an error in Tramp for rsync
[gnu-emacs] / src / textprop.c
index 3f7c8d106395e9b446946eec56a880a83ab647a7..aabd5671e76035a5b0cc919119d0e9c911d6dfb0 100644 (file)
@@ -1,13 +1,13 @@
 /* Interface code for dealing with text properties.
-   Copyright (C) 1993-1995, 1997, 1999-2015 Free Software Foundation,
+   Copyright (C) 1993-1995, 1997, 1999-2016 Free Software Foundation,
    Inc.
 
 This file is part of GNU Emacs.
 
 GNU Emacs is free software: you can redistribute it and/or modify
 it under the terms of the GNU General Public License as published by
-the Free Software Foundation, either version 3 of the License, or
-(at your option) any later version.
+the Free Software Foundation, either version 3 of the License, or (at
+your option) any later version.
 
 GNU Emacs is distributed in the hope that it will be useful,
 but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -21,7 +21,6 @@ along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.  */
 
 #include "lisp.h"
 #include "intervals.h"
-#include "character.h"
 #include "buffer.h"
 #include "window.h"
 
@@ -2066,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;