aboutsummaryrefslogtreecommitdiff
path: root/src/site.c
diff options
context:
space:
mode:
authorYaroslav de la Peña Smirnov <yps@yaroslavps.com>2024-07-07 22:54:50 +0300
committerYaroslav de la Peña Smirnov <yps@yaroslavps.com>2024-07-07 22:56:53 +0300
commitb1d2d2a6391ca48ac477b585d69905431176ba17 (patch)
treea73674c731a26eb86e873f0f805d1d430f461b39 /src/site.c
parent43d153c00bb067276d3cda141ad62de27cb4971d (diff)
downloadrevela-b1d2d2a6391ca48ac477b585d69905431176ba17.tar.gz
revela-b1d2d2a6391ca48ac477b585d69905431176ba17.zip
fix: prerm_imagedir()v0.1.4
Fix re-rendering adjacent images' pages to the ones that are deleted.
Diffstat (limited to 'src/site.c')
-rw-r--r--src/site.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/site.c b/src/site.c
index 59cd669..83852f2 100644
--- a/src/site.c
+++ b/src/site.c
@@ -36,14 +36,14 @@ prerm_imagedir(const char *path, void *data)
return false;
}
if (S_ISDIR(st.st_mode)) {
- struct image *prev, *next = NULL;
+ struct image *prev = NULL, *next = NULL, *cur;
size_t i;
- vector_foreach (album->images, i, prev) {
- if (prev->tstamp > st.st_mtim.tv_sec) {
- prev = next;
+ vector_foreach (album->images, i, cur) {
+ if (cur->tstamp > st.st_mtim.tv_sec) {
+ next = cur;
break;
}
- next = prev;
+ prev = cur;
}
if (prev) {
if (!prev->modified) {
@@ -53,7 +53,7 @@ prerm_imagedir(const char *path, void *data)
}
}
}
- if (next != prev) {
+ if (next) {
if (!next->modified) {
joinpathb(htmlpath, next->dst, index_html);
if (!render_make_image(&album->site->render, htmlpath, next)) {