From fd76cff5f0781a7c61bf379d3b433f00be6b9d6a Mon Sep 17 00:00:00 2001 From: rdb Date: Sat, 29 Mar 2014 09:32:52 +0000 Subject: [PATCH] Patch by phx to support -C in all cases --- panda/src/downloadertools/multify.cxx | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/panda/src/downloadertools/multify.cxx b/panda/src/downloadertools/multify.cxx index 54482e4964..d9736336c5 100644 --- a/panda/src/downloadertools/multify.cxx +++ b/panda/src/downloadertools/multify.cxx @@ -202,8 +202,8 @@ help() { " -C \n" - " With -x, change to the named directory before extracting files;\n" - " that is, extract subfiles into the named directory.\n\n" + " Change to the named directory before working on files;\n" + " that is, extraction/creation/update and replace will be based on this path\n\n" " -O\n" " With -x, extract subfiles to standard output instead of to disk.\n\n" @@ -419,6 +419,12 @@ add_files(const vector_string ¶ms) { filenames.push_back(subfile_name); } + // Change current working directory, if requested. + if (got_chdir_to && chdir(chdir_to.c_str()) != 0) { + cout << "Failed to chdir to " << chdir_to << ": " << strerror(errno) << endl; + return false; + } + bool okflag = do_add_files(multifile, filenames); bool needs_repack = multifile->needs_repack();