aboutsummaryrefslogtreecommitdiff
path: root/text.c
diff options
context:
space:
mode:
Diffstat (limited to 'text.c')
-rw-r--r--text.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/text.c b/text.c
index 9879f98..39d47cc 100644
--- a/text.c
+++ b/text.c
@@ -610,6 +610,8 @@ int text_save(Text *txt, const char *filename) {
return -1;
txt->saved_action = txt->undo;
text_snapshot(txt);
+ if (!txt->filename)
+ txt->filename = strdup(filename);
return 0;
err:
close(fd);