Decompiler: Add .xml entension when user did not specify for DebugDecompilerAction

This commit is contained in:
xndcn 2025-06-11 20:32:17 +08:00
parent d4c034df15
commit faa9907deb

View file

@ -29,6 +29,7 @@ import ghidra.app.plugin.core.decompile.DecompilePlugin;
import ghidra.app.util.HelpTopics;
import ghidra.util.HelpLocation;
import ghidra.util.filechooser.ExtensionFileFilter;
import org.apache.commons.io.FilenameUtils;
public class DebugDecompilerAction extends DockingAction {
@ -57,6 +58,10 @@ public class DebugDecompilerAction extends DockingAction {
if (file == null) {
return;
}
// If user did not specify an extension, add .xml
if (FilenameUtils.getExtension(file.getPath()).isEmpty()) {
file = new File(file.getAbsolutePath() + ".xml");
}
if (file.exists()) {
if (OptionDialog.showYesNoDialog(parentComponent, "Overwrite Existing File?",
"Do you want to overwrite the existing file?") == OptionDialog.OPTION_TWO) {