aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorache <ache@ache.one>2020-09-11 14:26:21 +0200
committerache <ache@ache.one>2020-09-11 14:26:21 +0200
commit480341b3cd1370c32973a5f1ec320e996aab8989 (patch)
treec82f0b0f75af56a89b3b9d8fa513b7d8b25712cf
parent00aecb900595e37eec6ffab0b943677079b3b9d7 (diff)
Fix editHEADmaster
-rw-r--r--main.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/main.c b/main.c
index be077fd..3527241 100644
--- a/main.c
+++ b/main.c
@@ -436,7 +436,6 @@ int main(int argc, char* argv[]){
edit:
system(cmd);
- free(cmd);
{
FILE* r = fopen(fileName,"r");
FILE* t = tmpfile();
@@ -474,7 +473,6 @@ edit:
}
char* string = malloc( nb+1 );
fclose(r);
- unlink( fileName );
rewind(t);
nb = 0;
while( (c = fgetc(t)) != EOF ) {
@@ -507,6 +505,9 @@ edit:
goto edit;
}
}
+ // You must do it now because it can be used by the goto
+ unlink( fileName );
+ free(cmd);
resize();
}
case KEY_HOME: