diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/textprop.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/textprop.c b/src/textprop.c index cd07484204b..7c6a5e6d686 100644 --- a/src/textprop.c +++ b/src/textprop.c | |||
| @@ -1304,7 +1304,7 @@ set_text_properties (start, end, properties, object, signal_after_change_p) | |||
| 1304 | the text. This does not obey any hooks. | 1304 | the text. This does not obey any hooks. |
| 1305 | You can provide the interval that START is located in as I, | 1305 | You can provide the interval that START is located in as I, |
| 1306 | or pass NULL for I and this function will find it. | 1306 | or pass NULL for I and this function will find it. |
| 1307 | This function assumes that START < END. */ | 1307 | START and END can be in any order. */ |
| 1308 | 1308 | ||
| 1309 | void | 1309 | void |
| 1310 | set_text_properties_1 (start, end, properties, buffer, i) | 1310 | set_text_properties_1 (start, end, properties, buffer, i) |
| @@ -1317,7 +1317,14 @@ set_text_properties_1 (start, end, properties, buffer, i) | |||
| 1317 | 1317 | ||
| 1318 | s = XINT (start); | 1318 | s = XINT (start); |
| 1319 | len = XINT (end) - s; | 1319 | len = XINT (end) - s; |
| 1320 | eassert (len > 0); | 1320 | if (len == 0) |
| 1321 | return; | ||
| 1322 | if (len < 0) | ||
| 1323 | { | ||
| 1324 | s = s + len; | ||
| 1325 | len = - len; | ||
| 1326 | } | ||
| 1327 | |||
| 1321 | if (i == 0) | 1328 | if (i == 0) |
| 1322 | i = find_interval (BUF_INTERVALS (XBUFFER (buffer)), s); | 1329 | i = find_interval (BUF_INTERVALS (XBUFFER (buffer)), s); |
| 1323 | 1330 | ||