From 796b7f9a6634dfca070f928c18425ed03dd5f455 Mon Sep 17 00:00:00 2001 From: obarun <eric@obarun.org> Date: Sat, 15 Jul 2023 13:19:02 +1100 Subject: [PATCH] fix the recognition of last slash --- src/lib66/utils/set_livedir.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/lib66/utils/set_livedir.c b/src/lib66/utils/set_livedir.c index a4a22200..30042aac 100644 --- a/src/lib66/utils/set_livedir.c +++ b/src/lib66/utils/set_livedir.c @@ -29,10 +29,8 @@ int set_livedir(stralloc *live) if (live->s[0] != '/') return -1 ; - if (live->s[live->len - 2] != '/') { - live->len-- ; + if (live->s[live->len - 1] != '/') if (!auto_stra(live,"/")) log_warnsys_return(LOG_EXIT_ZERO,"stralloc") ; - } } else if (!auto_stra(live,SS_LIVE)) log_warnsys_return(LOG_EXIT_ZERO,"stralloc") ; -- GitLab