Index: src/XFileArchive.cpp --- src/XFileArchive.cpp.orig +++ src/XFileArchive.cpp @@ -521,6 +521,12 @@ long XFileArchive::onCmdExtractTo(FXObject*, FXSelecto return 0; } + // Change tar to gtar + if (compare(cmd, "tar ", 4) == 0) + { + cmd.prepend('g'); + } + // File selection dialog FileDialog browse(this, _("Select a Destination Folder")); const char* patterns[] = @@ -720,6 +726,12 @@ long XFileArchive::onCmdExtract(FXObject*, FXSelector, return 0; } + // Change tar to gtar + if (compare(cmd, "tar ", 4) == 0) + { + cmd.prepend('g'); + } + FXString message = _("Extract archive to folder: ") + parentdir + "\n\n" + _("Existing data will be overwritten..."); MessageBox box(this, _("Extract Archive"), message, bigarchexticon, BOX_OK_CANCEL | DECOR_TITLE | DECOR_BORDER); @@ -888,7 +900,7 @@ long XFileArchive::onCmdFileOpen(FXObject*, FXSelector tmppathname = tmpdir + FXPath::name(relpathname); // Extract command - FXString cmd = "tar -axf " + archpathname + " " + xf_quote(relpathname) + " -O > " + xf_quote(tmppathname); + FXString cmd = "gtar -axf " + archpathname + " " + xf_quote(relpathname) + " -O > " + xf_quote(tmppathname); // Wait cursor getApp()->beginWaitCursor(); @@ -1028,7 +1040,7 @@ long XFileArchive::onCmdFileOpenWith(FXObject*, FXSele tmppathname = tmpdir + FXPath::name(relpathname); // Extract command - FXString cmd = "tar -axf " + archpathname + " " + xf_quote(relpathname) + " -O > " + xf_quote(tmppathname); + FXString cmd = "gtar -axf " + archpathname + " " + xf_quote(relpathname) + " -O > " + xf_quote(tmppathname); // Wait cursor getApp()->beginWaitCursor(); @@ -1178,7 +1190,7 @@ long XFileArchive::onCmdFileExtract(FXObject*, FXSelec } // Extract command - FXString cmd = "tar -axf " + archpathname + " " + xf_quote(relpathname) + " -O > " + + FXString cmd = "gtar -axf " + archpathname + " " + xf_quote(relpathname) + " -O > " + xf_quote(parentdir + PATHSEPSTRING + filename); // Run command to extract file to parent directory @@ -1250,7 +1262,7 @@ long XFileArchive::onCmdFileExtractTo(FXObject*, FXSel } // Extract command - FXString cmd = "tar -axf " + archpathname + " " + xf_quote(relpathname) + " -O > " + + FXString cmd = "gtar -axf " + archpathname + " " + xf_quote(relpathname) + " -O > " + xf_quote(dir + PATHSEPSTRING + filename); // Run command to extract file to directory @@ -1396,7 +1408,7 @@ int XFileArchive::readArchive(void) || (ext1 == "tgz") || (ext1 == "tbz2") || (ext1 == "tbz") || (ext1 == "txz") || (ext1 == "taz") || (ext1 == "tzst")) { - if (!xf_existcommand("tar")) + if (!xf_existcommand("gtar")) { list->clearItems(); MessageBox::error(this, BOX_OK, _("Error"), _("Unarchive program %s was not found"), "tar"); @@ -1404,7 +1416,7 @@ int XFileArchive::readArchive(void) } errorflag = false; - cmd = "tar -atvf "; + cmd = "gtar -atvf "; } else if (ext1 == "tar") {