aboutsummaryrefslogtreecommitdiff
path: root/server.c
diff options
context:
space:
mode:
authorOmar Polo <op@omarpolo.com>2021-04-30 19:07:37 +0000
committerOmar Polo <op@omarpolo.com>2021-04-30 19:07:37 +0000
commit737a6b50c599460a5e69c8a89e41f9881ff07f88 (patch)
tree7d6bb9326bb8934b7b6dbbcd2ceccc8fc8830b42 /server.c
parentfdea6aa0bca24f6f947e2126ce101fd59caa7a31 (diff)
ensure %p (path) is always absolute
with the recent changes, sometimes the path may not start with a '/'. This ensures that %s is ALWAYS an absolute path.
Diffstat (limited to 'server.c')
-rw-r--r--server.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/server.c b/server.c
index 60d1da8..79c7d9c 100644
--- a/server.c
+++ b/server.c
@@ -514,6 +514,8 @@ fmt_sbuf(const char *fmt, struct client *c, const char *path)
strlcat(c->sbuf, "%", sizeof(c->sbuf));
break;
case 'p':
+ if (*path != '/')
+ strlcat(c->sbuf, "/", sizeof(c->sbuf));
strlcat(c->sbuf, path, sizeof(c->sbuf));
break;
case 'q':