summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorLukas Fleischer <lfleischer@calcurse.org>2017-09-07 19:48:33 +0200
committerLukas Fleischer <lfleischer@calcurse.org>2017-09-08 21:08:53 +0200
commitfb1524b4e26c55e15c12332fc85b3805645ae228 (patch)
tree38f0a88007d84781aa59ed5200dc0a602c86fac8 /src
parente5a824e5766f6c33f766b02ba0e56a6cafab4f72 (diff)
downloadcalcurse-fb1524b4e26c55e15c12332fc85b3805645ae228.tar.gz
calcurse-fb1524b4e26c55e15c12332fc85b3805645ae228.zip
Use .new as file extension when merging
Using the file name extension .sav and naming the variables "backup" is slightly misleading, since the affected files actually contain the updated content and not some old snapshot. Use the term "new" instead. Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
Diffstat (limited to 'src')
-rw-r--r--src/io.c30
1 files changed, 15 insertions, 15 deletions
diff --git a/src/io.c b/src/io.c
index 55ec22b..1233fbe 100644
--- a/src/io.c
+++ b/src/io.c
@@ -426,43 +426,43 @@ unsigned io_save_keys(void)
static void io_merge_data(void)
{
- char *path_apts_backup, *path_todo_backup;
- const char *backup_ext = ".sav";
+ char *path_apts_new, *path_todo_new;
+ const char *new_ext = ".new";
- asprintf(&path_apts_backup, "%s%s", path_apts, backup_ext);
- asprintf(&path_todo_backup, "%s%s", path_todo, backup_ext);
+ asprintf(&path_apts_new, "%s%s", path_apts, new_ext);
+ asprintf(&path_todo_new, "%s%s", path_todo, new_ext);
io_save_mutex_lock();
- io_save_apts(path_apts_backup);
- io_save_todo(path_todo_backup);
+ io_save_apts(path_apts_new);
+ io_save_todo(path_todo_new);
io_save_mutex_unlock();
/*
* We do not directly write to the data files here; however, the
- * external merge tool might incorporate changes from the backup file
- * into the main data files.
+ * external merge tool might incorporate changes from the new file into
+ * the main data files.
*/
run_hook("pre-save");
- if (!io_files_equal(path_apts, path_apts_backup)) {
+ if (!io_files_equal(path_apts, path_apts_new)) {
const char *arg_apts[] = { conf.mergetool, path_apts,
- path_apts_backup, NULL };
+ path_apts_new, NULL };
wins_launch_external(arg_apts);
}
- if (!io_files_equal(path_todo, path_todo_backup)) {
+ if (!io_files_equal(path_todo, path_todo_new)) {
const char *arg_todo[] = { conf.mergetool, path_todo,
- path_todo_backup, NULL };
+ path_todo_new, NULL };
wins_launch_external(arg_todo);
}
- mem_free(path_apts_backup);
- mem_free(path_todo_backup);
+ mem_free(path_apts_new);
+ mem_free(path_todo_new);
/*
* We do not directly write to the data files here; however, the
* external merge tool will likely have incorporated changes from the
- * backup file into the main data files at this point.
+ * new file into the main data files at this point.
*/
run_hook("post-save");
}