From: Paul Eggert Date: Mon, 4 Apr 2011 19:30:48 +0000 (-0700) Subject: * textprop.c (set_text_properties_1): Change while to do-while, X-Git-Tag: emacs-pretest-24.0.90~104^2~275^2~394^2~23 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=1e792e4d80f58bdb5b460518729eb0585b10f8d3;p=emacs.git * textprop.c (set_text_properties_1): Change while to do-while, since the condition is always true at first. --- 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,