@@ -124,7 +124,7 @@ void parseArguments(int argc, char* argv[])
124124 (" X,extract-file" ,
125125 " Extract file(s) matching exactly." ,
126126 cxxopts::value<std::vector<std::string>>(appCtx.m_extract .xFilenames ), " [FILE...]" )
127- (" o,outdir" , " Output directory for extracted files." , cxxopts::value<std::string>(appCtx.m_extract .outDir )->default_value (" ./ " ), " [PATH]" )
127+ (" o,outdir" , " Output directory for extracted files." , cxxopts::value<std::string>(appCtx.m_extract .outDir )->default_value (" ." ), " [PATH]" )
128128 (" p,stdout" , " Pipe content of a file(s) to stdout instead writing it to the filesystem." , cxxopts::value<bool >(appCtx.m_extract .stdOut ))
129129 (" P,progress" , " Notify about progress during extraction." , cxxopts::value<bool >(appCtx.m_extract .progress ))
130130 (" n,dry-run" , " Simulate extraction process without writing any data to the filesystem." , cxxopts::value<bool >(appCtx.m_extract .dryRun ));
@@ -194,7 +194,7 @@ void extractFilenames(StorageExplorer& stExplorer, const std::vector<std::string
194194
195195 for (const auto & storedFilename : filesToExtract) {
196196 std::string targetFile = appCtx.m_extract .outDir ;
197- if (targetFile.at (targetFile.size () - 1 ) != PATH_SEP_CHAR ) {
197+ if (targetFile.at (targetFile.size () - 1 ) != ' \\ ' && targetFile. at (targetFile. size () - 1 ) != ' / ' ) {
198198 targetFile += PATH_SEP_STR ;
199199 }
200200 targetFile += storedFilename;
@@ -207,7 +207,7 @@ void extractFilenames(StorageExplorer& stExplorer, const std::vector<std::string
207207 size_t fileSize = 0 ;
208208 if (!appCtx.m_extract .dryRun ) {
209209 // normalize slashes in the paths received from CASC and force '/'
210- std::replace (targetFile.begin (), targetFile.end (), ' \\ ' , PATH_SEP_CHAR );
210+ std::replace (targetFile.begin (), targetFile.end (), ' \\ ' , ' / ' );
211211
212212 fileSize = stExplorer.extractFileToPath (storedFilename, targetFile);
213213 PLOG_DEBUG << " Written " << formatFileSize (fileSize) << " to " << targetFile;
0 commit comments