Changeset 13772


Ignore:
Timestamp:
Jan 5, 2013, 5:50:48 PM (8 years ago)
Author:
jordan
Message:

(2.7x, cli) backport r13764 for #5212

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2.7x/cli/cli.c

    r13625 r13772  
    232232  size_t        fileLength;
    233233  const char  * str;
    234   char          buf[TR_PATH_MAX];
    235234
    236235  tr_formatter_mem_init (MEM_K, MEM_K_STR, MEM_M_STR, MEM_G_STR, MEM_T_STR);
     
    268267  if (tr_bencDictFindStr (&settings, TR_PREFS_KEY_DOWNLOAD_DIR, &str))
    269268    {
    270       str = tr_realpath (str, buf);
    271 
    272       if (str != NULL)
     269      if (!tr_fileExists (str, NULL))
     270        tr_mkdirp (str, 0700);
     271
     272      if (tr_fileExists (str, NULL))
    273273        {
    274274          tr_bencDictAddStr (&settings, TR_PREFS_KEY_DOWNLOAD_DIR, str);
     
    276276      else
    277277        {
    278           fprintf (stderr, "Download directory does not exist!\n");
     278          fprintf (stderr, "Unable to create download directory \"%s\"!\n", str);
    279279          return EXIT_FAILURE;
    280280        }
Note: See TracChangeset for help on using the changeset viewer.