From 4de4322b2c278215a27d0f10604fa5947fcbc0be Mon Sep 17 00:00:00 2001 From: Jordan Lee Date: Wed, 16 Jan 2013 00:21:02 +0000 Subject: [PATCH] (cli) #5212 'cli fails when download directory doesn't exist' -- fix 2.76 regression introduced in r13764 (trunk) / r13772 (branches/2.7x) --- cli/cli.c | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/cli/cli.c b/cli/cli.c index ce53bb82d..e6867a040 100644 --- a/cli/cli.c +++ b/cli/cli.c @@ -267,16 +267,14 @@ main (int argc, char ** argv) if (tr_variantDictFindStr (&settings, TR_KEY_download_dir, &str, NULL)) { if (!tr_fileExists (str, NULL)) - tr_mkdirp (str, 0700); + { + tr_mkdirp (str, 0700); - if (tr_fileExists (str, NULL)) - { - tr_variantDictAddStr (&settings, TR_KEY_download_dir, str); - } - else - { - fprintf (stderr, "Unable to create download directory \"%s\"!\n", str); - return EXIT_FAILURE; + if (!tr_fileExists (str, NULL)) + { + fprintf (stderr, "Unable to create download directory \"%s\"!\n", str); + return EXIT_FAILURE; + } } }