Mercurial > emacs
comparison src/intervals.c @ 2779:857bb0f59668
* intervals.c (set_point): Check for point out of bounds before
checking for an empty interval tree.
author | Jim Blandy <jimb@redhat.com> |
---|---|
date | Fri, 14 May 1993 14:40:56 +0000 |
parents | c7e1308a7184 |
children | 962106f58afe |
comparison
equal
deleted
inserted
replaced
2778:071fa2f469d7 | 2779:857bb0f59668 |
---|---|
1252 int old_position = buffer->text.pt; | 1252 int old_position = buffer->text.pt; |
1253 | 1253 |
1254 if (position == buffer->text.pt) | 1254 if (position == buffer->text.pt) |
1255 return; | 1255 return; |
1256 | 1256 |
1257 /* Check this now, before checking if the buffer has any intervals. | |
1258 That way, we can catch conditions which break this sanity check | |
1259 whether or not there are intervals in the buffer. */ | |
1260 if (position > BUF_Z (buffer) || position < BUF_BEG (buffer)) | |
1261 abort (); | |
1262 | |
1257 if (NULL_INTERVAL_P (buffer->intervals)) | 1263 if (NULL_INTERVAL_P (buffer->intervals)) |
1258 { | 1264 { |
1259 buffer->text.pt = position; | 1265 buffer->text.pt = position; |
1260 return; | 1266 return; |
1261 } | 1267 } |
1262 | |
1263 /* Perhaps we should just change `position' to the limit. */ | |
1264 if (position > BUF_Z (buffer) || position < BUF_BEG (buffer)) | |
1265 abort (); | |
1266 | 1268 |
1267 /* Position Z is really one past the last char in the buffer. */ | 1269 /* Position Z is really one past the last char in the buffer. */ |
1268 if (position == BUF_ZV (buffer)) | 1270 if (position == BUF_ZV (buffer)) |
1269 iposition = position - 1; | 1271 iposition = position - 1; |
1270 | 1272 |