aboutsummaryrefslogtreecommitdiffstats
path: root/main.c
diff options
context:
space:
mode:
authorNRK <nrk@disroot.org>2022-07-30 10:05:10 +0200
committerNRK <nrk@disroot.org>2022-07-30 10:05:10 +0200
commit94d531fd827457cf71fe7f3808c7a2f531dceba5 (patch)
tree0ac8b2f178c83c0292a28aea7e6d73f451531a44 /main.c
parent6d8ec5aee31f8eff0288e598372ab94397741a03 (diff)
downloadnsxiv-94d531fd827457cf71fe7f3808c7a2f531dceba5.tar.zst
autoreload: simplify and cleanup (#342)
the current code is quite hacky and complex as it mixes multiple pointers. all of this complexity is unnecessary. drop it by introducing an explicit scratch buffer instead of implicitly abusing `arl->filename` as one. this also reduces some unnecessary allocation overhead. additionally, the argument to arl_setup must be the result of `realpath(3)` (as commented in `nsxiv.h`). instead of commenting it, assert it. and lastly, rename `arl_setup` to `arl_add` since it's not doing any "setup" but rather *adding* a file to watch. Reviewed-on: https://codeberg.org/nsxiv/nsxiv/pulls/342 Reviewed-by: explosion-mental <explosion-mental@noreply.codeberg.org>
Diffstat (limited to 'main.c')
-rw-r--r--main.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/main.c b/main.c
index 87dfc14..12cf404 100644
--- a/main.c
+++ b/main.c
@@ -350,7 +350,7 @@ void load_image(int new)
close_info();
open_info();
- arl_setup(&arl, files[fileidx].path);
+ arl_add(&arl, files[fileidx].path);
title_dirty = true;
if (img.multi.cnt > 0 && img.multi.animate)