From 46fb0c2419ec863a6749553a4166116ef95fdf21 Mon Sep 17 00:00:00 2001 From: Richard Nyberg Date: Wed, 23 May 2007 08:20:28 +0000 Subject: [PATCH] Fix the '--topdir' option for single file torrents without a top directory. Such torrents were saved as 'name/name' instead of 'name'. The option broke in rev253. Patch from borg@uu3.net. --- cli/add.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cli/add.c b/cli/add.c index e88a0b0..4f55b9d 100644 --- a/cli/add.c +++ b/cli/add.c @@ -81,7 +81,7 @@ cmd_add(int argc, char **argv) iob = buf_init(PATH_MAX); buf_write(&iob, dir, dirlen); - if (topdir) { + if (topdir && !mi_simple(mi)) { size_t tdlen; const char *td = benc_dget_mem(benc_dget_dct(mi, "info"), "name", &tdlen);