]> git.wh0rd.org Git - nano.git/commitdiff
Preventing a segfault when spellchecking a marked region
authorBenno Schulenberg <bensberg@justemail.net>
Mon, 13 Jul 2015 18:04:05 +0000 (18:04 +0000)
committerBenno Schulenberg <bensberg@justemail.net>
Mon, 13 Jul 2015 18:04:05 +0000 (18:04 +0000)
and nonewlines isn't set.

git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5298 35c25a1d-7b9e-4130-9fde-d3aeb78583b8

ChangeLog
src/files.c

index c657033c5c41dcb5354d26eade4ee12e1464fad7..e462564c9de925ad6346027c0dafb6de3627122d 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,8 @@
 2015-07-13  Benno Schulenberg  <bensberg@justemail.net>
        * src/text.c (do_int_spell_fix, do_alt_speller): Remove an unneeded
        condition; 'added_magicline' can only be true when NO_NEWLINES isn't.
+       * src/files.c (replace_buffer): Prevent a segfault when spellchecking
+       a marked region and nonewlines isn't set.
 
 2015-07-12  Benno Schulenberg  <bensberg@justemail.net>
        * src/text.c (do_alt_speller): Rename the variable 'totsize_save'
index 42e1b95e1f11d61afeba389980f1929bf2ef9f2f..2198fac203047822f9eabfcaed6a3f6d4ffa3e0c 100644 (file)
@@ -420,6 +420,9 @@ void replace_buffer(const char *filename)
     /* If opening the file succeeded, read it in. */
     if (descriptor > 0)
        read_file(f, descriptor, filename, FALSE, TRUE);
+
+    /* Put current at a place that is certain to exist. */
+    openfile->current = openfile->fileage;
 }
 #endif /* !DISABLE_SPELLER */