Not setting the modified flag when an external spell checker
didn't make any changes. git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5140 35c25a1d-7b9e-4130-9fde-d3aeb78583b8master
parent
6898c60ba6
commit
52d1c20973
|
@ -1,3 +1,8 @@
|
||||||
|
2015-03-17 Benno Schulenberg <bensberg@justemail.net>
|
||||||
|
* src/text.c (do_alt_speller): Do not set the modified flag when
|
||||||
|
an external spell checker didn't make any changes. This fixes
|
||||||
|
Savannah bug #44320, reported by Cody A. Taylor.
|
||||||
|
|
||||||
2015-03-14 Benno Schulenberg <bensberg@justemail.net>
|
2015-03-14 Benno Schulenberg <bensberg@justemail.net>
|
||||||
* src/text.c (do_formatter): Fix a message plus a few comments.
|
* src/text.c (do_formatter): Fix a message plus a few comments.
|
||||||
|
|
||||||
|
|
15
src/text.c
15
src/text.c
|
@ -2664,6 +2664,8 @@ const char *do_alt_speller(char *tempfile_name)
|
||||||
size_t pww_save = openfile->placewewant;
|
size_t pww_save = openfile->placewewant;
|
||||||
ssize_t current_y_save = openfile->current_y;
|
ssize_t current_y_save = openfile->current_y;
|
||||||
ssize_t lineno_save = openfile->current->lineno;
|
ssize_t lineno_save = openfile->current->lineno;
|
||||||
|
struct stat spellfileinfo;
|
||||||
|
__time_t timestamp;
|
||||||
pid_t pid_spell;
|
pid_t pid_spell;
|
||||||
char *ptr;
|
char *ptr;
|
||||||
static int arglen = 3;
|
static int arglen = 3;
|
||||||
|
@ -2699,6 +2701,10 @@ const char *do_alt_speller(char *tempfile_name)
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Get the timestamp of the temporary file. */
|
||||||
|
stat(tempfile_name, &spellfileinfo);
|
||||||
|
timestamp = spellfileinfo.st_mtime;
|
||||||
|
|
||||||
endwin();
|
endwin();
|
||||||
|
|
||||||
/* Set up an argument list to pass execvp(). */
|
/* Set up an argument list to pass execvp(). */
|
||||||
|
@ -2841,9 +2847,14 @@ const char *do_alt_speller(char *tempfile_name)
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Go back to the old position, and mark the file as modified. */
|
/* Go back to the old position. */
|
||||||
do_gotopos(lineno_save, current_x_save, current_y_save, pww_save);
|
do_gotopos(lineno_save, current_x_save, current_y_save, pww_save);
|
||||||
set_modified();
|
|
||||||
|
/* Stat the temporary file again, and mark the buffer as modified only
|
||||||
|
* if this file was changed since it was written. */
|
||||||
|
stat(tempfile_name, &spellfileinfo);
|
||||||
|
if (spellfileinfo.st_mtime != timestamp)
|
||||||
|
set_modified();
|
||||||
|
|
||||||
#ifndef NANO_TINY
|
#ifndef NANO_TINY
|
||||||
/* Handle a pending SIGWINCH again. */
|
/* Handle a pending SIGWINCH again. */
|
||||||
|
|
Loading…
Reference in New Issue