From: David Lawrence Ramsey Date: Wed, 1 Jun 2005 04:23:52 +0000 (+0000) Subject: clarify a comment, and don't try to display the buffer name in X-Git-Tag: v1.3.8~230 X-Git-Url: https://git.wh0rd.org/?a=commitdiff_plain;h=dac3bca274c25bb15842ec0ebbaa526b50d52b85;p=nano.git clarify a comment, and don't try to display the buffer name in die_save_file() if it's been blanked out by get_next_file()'s failure to find a unique filename git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2573 35c25a1d-7b9e-4130-9fde-d3aeb78583b8 --- diff --git a/src/files.c b/src/files.c index 2c02cfa4..4e6d46c7 100644 --- a/src/files.c +++ b/src/files.c @@ -402,7 +402,8 @@ char *get_next_filename(const char *name, const char *suffix) sprintf(buf + namelen + suffixlen, ".%lu", i); } - /* We get here only if there is no possible save file. */ + /* We get here only if there is no possible save file. Blank out + * the filename to indicate this. */ null_at(&buf, 0); return buf; diff --git a/src/nano.c b/src/nano.c index fc823078..d10f0031 100644 --- a/src/nano.c +++ b/src/nano.c @@ -175,8 +175,11 @@ void die_save_file(const char *die_filename) if (!failed) fprintf(stderr, _("\nBuffer written to %s\n"), retval); - else + else if (retval[0] != '\0') fprintf(stderr, _("\nBuffer not written to %s: %s\n"), retval, + strerror(errno)); + else + fprintf(stderr, _("\nBuffer not written: %s\n"), _("Too many backup files?")); free(retval);