From: David Lawrence Ramsey Date: Tue, 31 May 2005 03:33:30 +0000 (+0000) Subject: cosmetic fixes X-Git-Tag: v1.3.8~235 X-Git-Url: https://git.wh0rd.org/?a=commitdiff_plain;h=0998a64fb9cea4aa63487f5298ab6dedcc7f868d;p=nano.git cosmetic fixes git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2568 35c25a1d-7b9e-4130-9fde-d3aeb78583b8 --- diff --git a/src/files.c b/src/files.c index a07dac9f..aae0b488 100644 --- a/src/files.c +++ b/src/files.c @@ -1370,7 +1370,7 @@ int write_file(const char *name, bool tmp, int append, bool anyexists = (lstat(realname, &lst) != -1); - /* New case: if the file exists, just give up. */ + /* If the temp file exists, give up. */ if (tmp && anyexists) goto cleanup_and_exit; @@ -1395,7 +1395,6 @@ int write_file(const char *name, bool tmp, int append, bool if (ISSET(BACKUP_FILE) && !tmp && realexists && (append != 0 || ISSET(MARK_ISSET) || originalfilestat.st_mtime == st.st_mtime)) { - FILE *backup_file; char *backupname; struct utimbuf filetime; @@ -1568,7 +1567,7 @@ int write_file(const char *name, bool tmp, int append, bool } /* Now open the file in place. Use O_EXCL if tmp is TRUE. This is - * now copied from joe, because wiggy says so *shrug*. */ + * copied from joe, because wiggy says so *shrug*. */ fd = open(realname, O_WRONLY | O_CREAT | ((append == 1) ? O_APPEND : (tmp ? O_EXCL : O_TRUNC)), S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH); diff --git a/src/nano.c b/src/nano.c index 1fa27a33..dfe28cbd 100644 --- a/src/nano.c +++ b/src/nano.c @@ -2125,7 +2125,7 @@ const char *do_int_speller(const char *tempfile_name) } - *read_buff_ptr = (char)NULL; + *read_buff_ptr = '\0'; close(uniq_fd[0]); /* Process the spelling errors. */ @@ -2134,7 +2134,7 @@ const char *do_int_speller(const char *tempfile_name) while (*read_buff_ptr != '\0') { if ((*read_buff_ptr == '\n') || (*read_buff_ptr == '\r')) { - *read_buff_ptr = (char)NULL; + *read_buff_ptr = '\0'; if (read_buff_word != read_buff_ptr) { if (!do_int_spell_fix(read_buff_word)) { read_buff_word = read_buff_ptr;