diff options
author | Karl Heuer <kwzh@gnu.org> | 1995-04-20 21:15:39 +0000 |
---|---|---|
committer | Karl Heuer <kwzh@gnu.org> | 1995-04-20 21:15:39 +0000 |
commit | 1390593bbf71eda739a2d2fdff8884a50f70c239 (patch) | |
tree | 7c0df19d2486bd278916a8ab4d5418d6f697dda8 /src/abbrev.c | |
parent | 1cf80a021d6177ec5137ede904f438ad7c214d6e (diff) | |
download | emacs-1390593bbf71eda739a2d2fdff8884a50f70c239.tar.gz |
(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.") expansion". */ value = (MODIFF != oldmodiff ? Qt : Qnil); - if (XBUFFER (Vabbrev_start_location_buffer) != current_buffer) + wordstart = 0; + if (!(BUFFERP (Vabbrev_start_location_buffer) && + XBUFFER (Vabbrev_start_location_buffer) == current_buffer)) Vabbrev_start_location = Qnil; if (!NILP (Vabbrev_start_location)) { @@ -237,10 +239,12 @@ Returns t if expansion took place.") CHECK_NUMBER_COERCE_MARKER (tem, 0); wordstart = XINT (tem); Vabbrev_start_location = Qnil; - if (FETCH_CHAR (wordstart) == '-') + if (wordstart < BEGV || wordstart > ZV) + wordstart = 0; + if (wordstart && wordstart != ZV && FETCH_CHAR (wordstart) == '-') del_range (wordstart, wordstart + 1); } - else + if (!wordstart) wordstart = scan_words (point, -1); if (!wordstart) |