about summary refs log tree commit diff
path: root/src/config
diff options
context:
space:
mode:
authorLaurent Bercot <ska-skaware@skarnet.org>2023-08-22 10:53:59 +0000
committerLaurent Bercot <ska@appnovation.com>2023-08-22 10:53:59 +0000
commit8dd7b34dee5407324616dad6405d50aae4998b32 (patch)
tree173125ee1f1b63171d5507e56fcc5ece482f6c55 /src/config
parent97eae758b6ba3f4f951a54282a1fc57c721cf037 (diff)
downloadtipidee-8dd7b34dee5407324616dad6405d50aae4998b32.tar.gz
tipidee-8dd7b34dee5407324616dad6405d50aae4998b32.tar.xz
tipidee-8dd7b34dee5407324616dad6405d50aae4998b32.zip
Fix redirection with sub
Signed-off-by: Laurent Bercot <ska@appnovation.com>
Diffstat (limited to 'src/config')
-rw-r--r--src/config/lexparse.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/config/lexparse.c b/src/config/lexparse.c
index a051f93..a7ed5b2 100644
--- a/src/config/lexparse.c
+++ b/src/config/lexparse.c
@@ -185,7 +185,9 @@ static inline void parse_redirect (char const *s, size_t const *word, size_t n,
     confnode_start(&node, key, md->filepos, md->line) ;
     key[0] = '@' | i ;
     confnode_add(&node, &key[0], 1) ;
-    confnode_add(&node, s + word[2], strlen(s + word[2]) + 1) ;
+    urlen = strlen(s + word[2]) ;
+    confnode_add(&node, s + word[2], urlen - (s[word[2] + urlen - 1] == '/')) ;
+    confnode_add(&node, "", 1) ;
     conftree_add(&node) ;
   }
 }