Skip to content

Commit

Permalink
Merge pull request #627 from ghaerr/kilo
Browse files Browse the repository at this point in the history
[cmds] Fix kilo delete bug
  • Loading branch information
ghaerr authored May 12, 2020
2 parents 552b5e7 + 0f37882 commit 9ae344f
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions elkscmd/misc_utils/kilo.c
Original file line number Diff line number Diff line change
Expand Up @@ -810,9 +810,11 @@ int editorOpen(char *filename) {

/* Save the current file on disk. Return 0 on success, 1 on error. */
int editorSave(void) {
int len;
int len, fd;
char *buf = editorRowsToString(&len);
int fd = open(E.filename,O_RDWR|O_CREAT,0644);

unlink(E.filename);
fd = open(E.filename,O_RDWR|O_CREAT,0644);
if (fd == -1) goto writeerr;

#if 0
Expand Down

0 comments on commit 9ae344f

Please sign in to comment.