diff options
| author | Bruce Hill <bruce@bruce-hill.com> | 2019-06-09 15:46:34 -0700 |
|---|---|---|
| committer | Bruce Hill <bruce@bruce-hill.com> | 2019-06-09 15:46:34 -0700 |
| commit | 399b63f57c9e53463add311048532916353a7fbb (patch) | |
| tree | 91ed687c2c6a111ae9dfad48bfd849e3e59c4d29 | |
| parent | f2151f7835df7f7e33c0ce566edcf7b62324ceb2 (diff) | |
Fix for being unable to deselect nonexistant files
| -rw-r--r-- | bb.c | 12 |
1 files changed, 11 insertions, 1 deletions
@@ -1007,7 +1007,17 @@ bb_result_t execute_cmd(bb_t *bb, const char *cmd) return BB_OK; } else { entry_t *e = load_entry(bb, value); - if (e) deselect_entry(bb, e); + if (e) { + deselect_entry(bb, e); + return BB_OK; + } + // Filename may no longer exist: + for (e = bb->firstselected; e; e = e->selected.next) { + if (strcmp(e->fullname, value) == 0) { + deselect_entry(bb, e); + break; + } + } return BB_OK; } } |
