Fix: Game files with space in the name was not handled correctly when run in Vice

This commit is contained in:
lantzelot-swe 2020-12-31 16:30:38 +01:00
parent 4ac6cb7edc
commit 5bba1c75d1
2 changed files with 5 additions and 9 deletions

View File

@ -662,7 +662,7 @@ public class ScreenshotsPanel extends JPanel
} }
fileChooser.setCurrentDirectory(new File(gameDir)); fileChooser.setCurrentDirectory(new File(gameDir));
FileNameExtensionFilter vicefilter = new FileNameExtensionFilter("Vice runnable files", "d64", "t64", "VSF", "GZ", "crt", "prg", "g64"); FileNameExtensionFilter vicefilter = new FileNameExtensionFilter("Vice runnable files", "d64", "t64", "tap", "VSF", "GZ", "crt", "prg", "g64");
fileChooser.addChoosableFileFilter(vicefilter); fileChooser.addChoosableFileFilter(vicefilter);
fileChooser.setFileFilter(vicefilter); fileChooser.setFileFilter(vicefilter);
int value = fileChooser.showOpenDialog(MainWindow.getInstance()); int value = fileChooser.showOpenDialog(MainWindow.getInstance());

View File

@ -418,31 +418,27 @@ public class FileManager
} }
//Append game file //Append game file
String gameFileToRun = gameFile;
Path gamePath = infoModel.getGamesPath(); Path gamePath = infoModel.getGamesPath();
if (gamePath != null) if (gamePath != null)
{ {
if (gamePath.toString().contains("crt")) if (gamePath.toString().contains("crt"))
{ {
command.append("-cartcrt " + gamePath.toString()); command.append("-cartcrt \"" + gamePath.toString() + "\"");
} }
else else
{ {
command.append("-autostart " + gamePath.toString()); command.append("-autostart \"" + gamePath.toString() + "\"");
} }
} }
else else
{ {
if (gameFile.contains("crt")) if (gameFile.contains("crt"))
{ {
command.append("-cartcrt " + decompressIfNeeded(gameFile)); command.append("-cartcrt \"" + decompressIfNeeded(gameFile) + "\"");
} }
else else
{ {
command.append("-autostart " + gameFile); command.append("-autostart \"" + gameFile + "\"");
} }
} }