]> granicus.if.org Git - transmission/commitdiff
(2.7x) backport r13793 for #5215 (a 2.76 regression)
authorJordan Lee <jordan@transmissionbt.com>
Wed, 16 Jan 2013 00:28:11 +0000 (00:28 +0000)
committerJordan Lee <jordan@transmissionbt.com>
Wed, 16 Jan 2013 00:28:11 +0000 (00:28 +0000)
cli/cli.c

index c779ab442cb6a6c7c96738de85cd60f2da06577b..a83be482a3ae2e7567d7c552049b12efa72ff1cc 100644 (file)
--- a/cli/cli.c
+++ b/cli/cli.c
@@ -267,16 +267,14 @@ main (int argc, char ** argv)
   if (tr_bencDictFindStr (&settings, TR_PREFS_KEY_DOWNLOAD_DIR, &str))
     {
       if (!tr_fileExists (str, NULL))
-        tr_mkdirp (str, 0700);
-
-      if (tr_fileExists (str, NULL))
-        {
-          tr_bencDictAddStr (&settings, TR_PREFS_KEY_DOWNLOAD_DIR, str);
-        }
-      else
         {
-          fprintf (stderr, "Unable to create download directory \"%s\"!\n", str);
-          return EXIT_FAILURE;
+          tr_mkdirp (str, 0700);
+
+          if (!tr_fileExists (str, NULL))
+            {
+              fprintf (stderr, "Unable to create download directory \"%s\"!\n", str);
+              return EXIT_FAILURE;
+            }
         }
     }