summaryrefslogtreecommitdiff
path: root/session.c
diff options
context:
space:
mode:
Diffstat (limited to 'session.c')
-rw-r--r--session.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/session.c b/session.c
index ac76511..5a07afb 100644
--- a/session.c
+++ b/session.c
@@ -177,8 +177,10 @@ static void session_write(Ted *ted) {
bool success = !ferror(fp);
success &= fclose(fp) == 0;
- if (success)
+ if (success) {
+ remove(filename2);
rename(filename1, filename2); // overwrite old session
+ }
}
}