From 1e792e4d80f58bdb5b460518729eb0585b10f8d3 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Mon, 4 Apr 2011 12:30:48 -0700 Subject: [PATCH] * textprop.c (set_text_properties_1): Change while to do-while, since the condition is always true at first. --- src/ChangeLog | 3 +++ src/textprop.c | 5 +++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index 9bd13eaeb7b..5c5d72c89cb 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,5 +1,8 @@ 2011-04-04 Paul Eggert + * textprop.c (set_text_properties_1): Change while to do-while, + since the condition is always true at first. + * intervals.c (graft_intervals_into_buffer): Mark var as used. (interval_deletion_adjustment): Return unsigned value. All uses changed. diff --git a/src/textprop.c b/src/textprop.c index cd89efeb38d..53f92ec936b 100644 --- a/src/textprop.c +++ b/src/textprop.c @@ -1379,8 +1379,8 @@ set_text_properties_1 (Lisp_Object start, Lisp_Object end, Lisp_Object propertie i = next_interval (i); } - /* We are starting at the beginning of an interval, I */ - while (len > 0) + /* We are starting at the beginning of an interval I. LEN is positive. */ + do { if (i == 0) abort (); @@ -1412,6 +1412,7 @@ set_text_properties_1 (Lisp_Object start, Lisp_Object end, Lisp_Object propertie i = next_interval (i); } + while (len > 0); } DEFUN ("remove-text-properties", Fremove_text_properties, -- 2.39.2