Skip to content

Commit e5f2ab7

Browse files
committed
v2.43 Check, save and use Command Root Directory field correctly when saving a REDUCE command.
1 parent 2d7c79b commit e5f2ab7

2 files changed

Lines changed: 5 additions & 3 deletions

File tree

src/fjwright/runreduce/REDUCEConfigDialog.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -252,16 +252,18 @@ private String fileOrDirTextFieldReadableCheck(TextField fileOrDirTextField, Str
252252
* This is a local save; nothing is saved back to Run-REDUCE.
253253
*/
254254
private void saveREDUCECommand(String commandName) throws FileNotFoundException {
255+
// Find the command cmd in REDUCECommandList with the current name commandName:
255256
REDUCECommand cmd = null;
256257
for (REDUCECommand c : reduceCommandList)
257258
if (c.name.equals(commandName)) {
258259
cmd = c;
259260
break;
260261
}
261262
if (cmd == null) return; // Report an error?
263+
// Update the elements of cmd:
262264
cmd.name = commandNameTextField.getText().trim(); // in case edited but not confirmed!
263-
String commandRootDir =
264-
cmd.rootDir.isEmpty() ? reduceRootDirTextField.getText().trim() : cmd.rootDir;
265+
String commandRootDir = cmd.rootDir = directoryTextFieldReadableCheck(commandRootDirTextField);
266+
if (commandRootDir.isEmpty()) commandRootDir = reduceRootDirTextField.getText().trim();
265267
// Must replace the whole command array because its length may have changed:
266268
List<String> commandList = new ArrayList<>();
267269
for (int i = 0; i < commandTextFieldArray.length; i++) {

src/fjwright/runreduce/RunREDUCEFrame.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -661,7 +661,7 @@ private void sourceForgeMenuItemAction() {
661661
RunREDUCE.hostServices.showDocument("https://sourceforge.net/projects/reduce-algebra/");
662662
}
663663

664-
static final String VERSION = "2.42";
664+
static final String VERSION = "2.43";
665665

666666
@FXML
667667
private void aboutMenuItemAction() {

0 commit comments

Comments
 (0)