Commit a37ebcf2 authored by Benno Schulenberg's avatar Benno Schulenberg
Browse files

Not unsetting the mark before the possible bailout for zero size.

git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5156 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
parent 92142bed
Showing with 11 additions and 7 deletions
+11 -7
...@@ -3,6 +3,8 @@ ...@@ -3,6 +3,8 @@
an error when the marked region is zero bytes long. The message an error when the marked region is zero bytes long. The message
is not needed -- it gets printed by the caller. This generalizes is not needed -- it gets printed by the caller. This generalizes
the fix for Savannah bug #29393. the fix for Savannah bug #29393.
* src/text.c (do_alt_speller): Do not unset the mark before the
possible bailout because of a zero-sized region.
2015-03-22 Chris Allegretta <chrisa@asty.org> 2015-03-22 Chris Allegretta <chrisa@asty.org>
* src/text.c (do_alt_speller): timestamp can just be a __time_t. * src/text.c (do_alt_speller): timestamp can just be a __time_t.
......
...@@ -2683,13 +2683,6 @@ const char *do_alt_speller(char *tempfile_name) ...@@ -2683,13 +2683,6 @@ const char *do_alt_speller(char *tempfile_name)
size_t totsize_save = openfile->totsize; size_t totsize_save = openfile->totsize;
/* Our saved value of totsize, used when we spell-check a marked /* Our saved value of totsize, used when we spell-check a marked
* selection. */ * selection. */
if (old_mark_set) {
/* If the mark is on, save the number of the line it starts on,
* and then turn the mark off. */
mb_lineno_save = openfile->mark_begin->lineno;
openfile->mark_set = FALSE;
}
#endif #endif
/* Get the timestamp and the size of the temporary file. */ /* Get the timestamp and the size of the temporary file. */
...@@ -2700,6 +2693,15 @@ const char *do_alt_speller(char *tempfile_name) ...@@ -2700,6 +2693,15 @@ const char *do_alt_speller(char *tempfile_name)
if (spellfileinfo.st_size == 0) if (spellfileinfo.st_size == 0)
return NULL; return NULL;
#ifndef NANO_TINY
if (old_mark_set) {
/* If the mark is on, save the number of the line it starts on,
* and then turn the mark off. */
mb_lineno_save = openfile->mark_begin->lineno;
openfile->mark_set = FALSE;
}
#endif
endwin(); endwin();
/* Set up an argument list to pass execvp(). */ /* Set up an argument list to pass execvp(). */
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment