projects
/
open-adventure.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
5ab94ce
)
Address Gitlib issu #57: Resume can't open save file...
author
Eric S. Raymond
<esr@thyrsus.com>
Mon, 4 Apr 2022 21:51:06 +0000
(17:51 -0400)
committer
Eric S. Raymond
<esr@thyrsus.com>
Mon, 4 Apr 2022 21:51:06 +0000
(17:51 -0400)
...when auto-completed filename is followed by a space character.
saveresume.c
patch
|
blob
|
history
diff --git
a/saveresume.c
b/saveresume.c
index 783e6714262b8857b487bec49a4cdbaf2b0b97a0..15d14c1472dbbdc09b784581ee30f9e3c9fd1d80 100644
(file)
--- a/
saveresume.c
+++ b/
saveresume.c
@@
-108,6
+108,9
@@
int resume(void)
while (fp == NULL) {
char* name = readline("\nFile name: ");
+ // Autocomplete can leave the input with an extra traoling space.
+ if (name != NULL && strlen(name) > 0 && name[strlen(name) - 1] == ' ')
+ name[strlen(name) - 1] = '\0';
if (name == NULL)
return GO_TOP;
fp = fopen(name, READ_MODE);