1
0
Fork 0
mirror of https://github.com/transmission/transmission synced 2024-12-25 17:17:31 +00:00

(cli) #5212 'cli fails when download directory doesn't exist' -- fix 2.76 regression introduced in r13764 (trunk) / r13772 (branches/2.7x)

This commit is contained in:
Jordan Lee 2013-01-16 00:21:02 +00:00
parent d4242140be
commit 4de4322b2c

View file

@ -267,18 +267,16 @@ main (int argc, char ** argv)
if (tr_variantDictFindStr (&settings, TR_KEY_download_dir, &str, NULL)) if (tr_variantDictFindStr (&settings, TR_KEY_download_dir, &str, NULL))
{ {
if (!tr_fileExists (str, NULL)) if (!tr_fileExists (str, NULL))
{
tr_mkdirp (str, 0700); tr_mkdirp (str, 0700);
if (tr_fileExists (str, NULL)) if (!tr_fileExists (str, NULL))
{
tr_variantDictAddStr (&settings, TR_KEY_download_dir, str);
}
else
{ {
fprintf (stderr, "Unable to create download directory \"%s\"!\n", str); fprintf (stderr, "Unable to create download directory \"%s\"!\n", str);
return EXIT_FAILURE; return EXIT_FAILURE;
} }
} }
}
h = tr_sessionInit ("cli", configDir, false, &settings); h = tr_sessionInit ("cli", configDir, false, &settings);