diff options
| author | Karl Heuer | 1995-04-20 21:15:39 +0000 |
|---|---|---|
| committer | Karl Heuer | 1995-04-20 21:15:39 +0000 |
| commit | dc7e2b301d8a9348c72faaacced7d1d08100ff88 (patch) | |
| tree | 6dddd9b737edfab309c1e6a89b8ece171dac047d /src/abbrev.c | |
| parent | f8c2630dfb3a1f267083974d375d1901e9b6c38e (diff) | |
| download | emacs-dc7e2b301d8a9348c72faaacced7d1d08100ff88.tar.gz emacs-dc7e2b301d8a9348c72faaacced7d1d08100ff88.zip | |
(Fexpand_abbrev): Add some error checking.
Diffstat (limited to 'src/abbrev.c')
| -rw-r--r-- | src/abbrev.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/abbrev.c b/src/abbrev.c index 244d530c464..e4a33941247 100644 --- a/src/abbrev.c +++ b/src/abbrev.c | |||
| @@ -229,7 +229,9 @@ Returns t if expansion took place.") | |||
| 229 | expansion". */ | 229 | expansion". */ |
| 230 | value = (MODIFF != oldmodiff ? Qt : Qnil); | 230 | value = (MODIFF != oldmodiff ? Qt : Qnil); |
| 231 | 231 | ||
| 232 | if (XBUFFER (Vabbrev_start_location_buffer) != current_buffer) | 232 | wordstart = 0; |
| 233 | if (!(BUFFERP (Vabbrev_start_location_buffer) && | ||
| 234 | XBUFFER (Vabbrev_start_location_buffer) == current_buffer)) | ||
| 233 | Vabbrev_start_location = Qnil; | 235 | Vabbrev_start_location = Qnil; |
| 234 | if (!NILP (Vabbrev_start_location)) | 236 | if (!NILP (Vabbrev_start_location)) |
| 235 | { | 237 | { |
| @@ -237,10 +239,12 @@ Returns t if expansion took place.") | |||
| 237 | CHECK_NUMBER_COERCE_MARKER (tem, 0); | 239 | CHECK_NUMBER_COERCE_MARKER (tem, 0); |
| 238 | wordstart = XINT (tem); | 240 | wordstart = XINT (tem); |
| 239 | Vabbrev_start_location = Qnil; | 241 | Vabbrev_start_location = Qnil; |
| 240 | if (FETCH_CHAR (wordstart) == '-') | 242 | if (wordstart < BEGV || wordstart > ZV) |
| 243 | wordstart = 0; | ||
| 244 | if (wordstart && wordstart != ZV && FETCH_CHAR (wordstart) == '-') | ||
| 241 | del_range (wordstart, wordstart + 1); | 245 | del_range (wordstart, wordstart + 1); |
| 242 | } | 246 | } |
| 243 | else | 247 | if (!wordstart) |
| 244 | wordstart = scan_words (point, -1); | 248 | wordstart = scan_words (point, -1); |
| 245 | 249 | ||
| 246 | if (!wordstart) | 250 | if (!wordstart) |