more miscellaneous minor fixes

git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4031 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
master
David Lawrence Ramsey 2007-01-11 22:46:22 +00:00
parent 30ca7d5219
commit 9e7b2d572c
4 changed files with 13 additions and 10 deletions

View File

@ -21,6 +21,10 @@ CVS code -
regexp_init() regexp_init()
- Don't assign rc's value via regcomp() until we've asserted - Don't assign rc's value via regcomp() until we've asserted
that regexp_compiled is FALSE. (DLR) that regexp_compiled is FALSE. (DLR)
- text.c:
do_alt_speller()
- Rename variable altspell_error to alt_spell_error, for
consistency. (DLR)
- winio.c: - winio.c:
do_credits() do_credits()
- Update the last copyright notice to include 2006. (DLR) - Update the last copyright notice to include 2006. (DLR)

View File

@ -1701,7 +1701,7 @@ bool write_file(const char *name, FILE *f_open, bool tmp, append_type
bool write_marked_file(const char *name, FILE *f_open, bool tmp, bool write_marked_file(const char *name, FILE *f_open, bool tmp,
append_type append) append_type append)
{ {
bool retval = FALSE; bool retval;
bool old_modified = openfile->modified; bool old_modified = openfile->modified;
/* write_file() unsets the modified flag. */ /* write_file() unsets the modified flag. */
bool added_magicline = FALSE; bool added_magicline = FALSE;

View File

@ -613,8 +613,7 @@ void die_save_file(const char *die_filename)
retval = get_next_filename(die_filename, ".save"); retval = get_next_filename(die_filename, ".save");
if (retval[0] != '\0') if (retval[0] != '\0')
failed = (write_file(retval, NULL, TRUE, OVERWRITE, failed = (!write_file(retval, NULL, TRUE, OVERWRITE, TRUE));
TRUE) == -1);
if (!failed) if (!failed)
fprintf(stderr, _("\nBuffer written to %s\n"), retval); fprintf(stderr, _("\nBuffer written to %s\n"), retval);

View File

@ -2197,7 +2197,7 @@ const char *do_alt_speller(char *tempfile_name)
if (!WIFEXITED(alt_spell_status) || if (!WIFEXITED(alt_spell_status) ||
WEXITSTATUS(alt_spell_status) != 0) { WEXITSTATUS(alt_spell_status) != 0) {
char *altspell_error; char *alt_spell_error;
char *invoke_error = _("Error invoking \"%s\""); char *invoke_error = _("Error invoking \"%s\"");
#ifndef NANO_TINY #ifndef NANO_TINY
@ -2205,11 +2205,11 @@ const char *do_alt_speller(char *tempfile_name)
openfile->mark_set = old_mark_set; openfile->mark_set = old_mark_set;
#endif #endif
altspell_error = alt_spell_error =
charalloc(strlen(invoke_error) + charalloc(strlen(invoke_error) +
strlen(alt_speller) + 1); strlen(alt_speller) + 1);
sprintf(altspell_error, invoke_error, alt_speller); sprintf(alt_spell_error, invoke_error, alt_speller);
return altspell_error; return alt_spell_error;
} }
#ifndef NANO_TINY #ifndef NANO_TINY
@ -2301,7 +2301,7 @@ const char *do_alt_speller(char *tempfile_name)
* specified, use it. Otherwise, use the internal spell checker. */ * specified, use it. Otherwise, use the internal spell checker. */
void do_spell(void) void do_spell(void)
{ {
int i; bool status;
FILE *temp_file; FILE *temp_file;
char *temp = safe_tempfile(&temp_file); char *temp = safe_tempfile(&temp_file);
const char *spell_msg; const char *spell_msg;
@ -2311,14 +2311,14 @@ void do_spell(void)
return; return;
} }
i = status =
#ifndef NANO_TINY #ifndef NANO_TINY
(openfile->mark_set) ? write_marked_file(temp, temp_file, TRUE, (openfile->mark_set) ? write_marked_file(temp, temp_file, TRUE,
OVERWRITE) : OVERWRITE) :
#endif #endif
write_file(temp, temp_file, TRUE, OVERWRITE, FALSE); write_file(temp, temp_file, TRUE, OVERWRITE, FALSE);
if (i == -1) { if (!status) {
statusbar(_("Error writing temp file: %s"), strerror(errno)); statusbar(_("Error writing temp file: %s"), strerror(errno));
free(temp); free(temp);
return; return;