Patch by phx to support -C in all cases

This commit is contained in:
rdb 2014-03-29 09:32:52 +00:00
parent d5d5de1d7e
commit fd76cff5f0

View File

@ -202,8 +202,8 @@ help() {
" -C <extract_dir>\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 &params) {
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();