commit 1b81ec8f1b960b981744f10fda90a2f0fd6a7c9c
parent 7dac38e1af1c24582f92ef8b58365b1a873a144f
Author: phoebos <ben@bvnf.space>
Date: Tue, 11 Oct 2022 15:39:05 +0100
ed: fix for no name given initially
Diffstat:
1 file changed, 4 insertions(+), 0 deletions(-)
diff --git a/ed.c b/ed.c
@@ -315,6 +315,10 @@ ed(char **startfile) {
* So there is one space between 'w' and the filename. */
c += 2;
if (c-cbuf >= c_used) {
+ if (*startfile == NULL) {
+ printf("?\n");
+ continue;
+ }
if (write_buf(*startfile) != 0)
continue;
changed = 0;