summaryrefslogtreecommitdiff
path: root/src/textprop.c
diff options
context:
space:
mode:
authorKim F. Storm <storm@cua.dk>2002-04-22 17:59:02 +0000
committerKim F. Storm <storm@cua.dk>2002-04-22 17:59:02 +0000
commitf25d60d646e84b783837351120087138529c9e95 (patch)
treed631cecf91dcb78e9bf873b1004cb4528d25fe59 /src/textprop.c
parent0347c911e909fbf5c1512067f9821d0476d8f9ee (diff)
downloademacs-f25d60d646e84b783837351120087138529c9e95.tar.gz
(remove_properties): Fixed trap for malformed plist.
Diffstat (limited to 'src/textprop.c')
-rw-r--r--src/textprop.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/src/textprop.c b/src/textprop.c
index 928c9f9b8b3..c85b4dcfd04 100644
--- a/src/textprop.c
+++ b/src/textprop.c
@@ -452,15 +452,15 @@ remove_properties (plist, list, i, object)
register Lisp_Object tail1, tail2, sym, current_plist;
register int changed = 0;
- /* Nonzero means tail1 is a list, otherwise it is a plist. */
- int use_list;
+ /* Nonzero means tail1 is a plist, otherwise it is a list. */
+ int use_plist;
current_plist = i->plist;
if (! NILP (plist))
- tail1 = plist, use_list = 0;
+ tail1 = plist, use_plist = 1;
else
- tail1 = list, use_list = 1;
+ tail1 = list, use_plist = 0;
/* Go through each element of LIST or PLIST. */
while (! NILP (tail1))
@@ -498,10 +498,9 @@ remove_properties (plist, list, i, object)
}
/* Advance thru TAIL1 one way or the other. */
- if (use_list)
+ tail1 = XCDR (tail1);
+ if (use_plist && CONSP (tail1))
tail1 = XCDR (tail1);
- else
- tail1 = XCDR (XCDR (tail1));
}
if (changed)