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:
parent
d4242140be
commit
4de4322b2c
1 changed files with 7 additions and 9 deletions
|
@ -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);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue