common: Make sure tilde expansion works for the mkdir functions.
authorNeal H. Walfield <neal@g10code.com>
Tue, 20 Oct 2015 10:10:03 +0000 (12:10 +0200)
committerNeal H. Walfield <neal@g10code.com>
Tue, 20 Oct 2015 10:17:46 +0000 (12:17 +0200)
* common/mkdir_p.c (gnupg_amkdir_p): Use make_filename_try on the
first directory component as well.

--
If there is only a single directory component, then tilde expansion
won't be done.

Signed-off-by: Neal H. Walfield <neal@g10code.com>
common/mkdir_p.c

index 2e93d65..37b44ec 100644 (file)
@@ -60,7 +60,7 @@ gnupg_amkdir_p (const char **directory_components)
   for (i = 0; directory_components[i]; i ++)
     {
       if (i == 0)
-       dirs[i] = xtrystrdup (directory_components[i]);
+       dirs[i] = make_filename_try (directory_components[i], NULL);
       else
        dirs[i] = make_filename_try (dirs[i-1], directory_components[i], NULL);
       if (!dirs[i])