]> git.wh0rd.org Git - nano.git/commitdiff
cosmetic fixes
authorDavid Lawrence Ramsey <pooka109@gmail.com>
Mon, 27 Nov 2006 05:40:09 +0000 (05:40 +0000)
committerDavid Lawrence Ramsey <pooka109@gmail.com>
Mon, 27 Nov 2006 05:40:09 +0000 (05:40 +0000)
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3979 35c25a1d-7b9e-4130-9fde-d3aeb78583b8

src/files.c

index a7710838e341134c0b23a88279861e397fa5d591..f67a5a20a15506b4bc6e413b1243ce219ea32492 100644 (file)
@@ -802,8 +802,8 @@ void do_insertfile(
 
            answer_len = strlen(answer);
 
-           /* Convert newlines to nulls, just before we execute a
-            * command. */
+           /* Convert newlines to nulls, just before we insert a file
+            * or execute a command. */
            sunder(answer);
 
 #ifndef NANO_TINY
@@ -1310,16 +1310,7 @@ int write_file(const char *name, FILE *f_open, bool tmp, append_type
     if (!tmp)
        titlebar(NULL);
 
-    realname = mallocstrcpy(NULL, name);
-
-    /* Convert newlines to nulls, just before we get the tilde-expanded
-     * filename. */
-    sunder(realname);
-
-    if (realname[0] == '\0')
-       goto cleanup_and_exit;
-
-    realname = mallocstrassn(realname, real_dir_from_tilde(realname));
+    realname = real_dir_from_tilde(name);
 
 #ifndef DISABLE_OPERATINGDIR
     /* If we're writing a temporary file, we're probably going outside