+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>
* src/text.c (do_formatter): Fix a message plus a few comments.
size_t pww_save = openfile->placewewant;
ssize_t current_y_save = openfile->current_y;
ssize_t lineno_save = openfile->current->lineno;
+ struct stat spellfileinfo;
+ __time_t timestamp;
pid_t pid_spell;
char *ptr;
static int arglen = 3;
return NULL;
}
+ /* Get the timestamp of the temporary file. */
+ stat(tempfile_name, &spellfileinfo);
+ timestamp = spellfileinfo.st_mtime;
+
endwin();
/* Set up an argument list to pass execvp(). */
}
#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);
- 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
/* Handle a pending SIGWINCH again. */