diff options
author | Omar Polo <op@omarpolo.com> | 2021-04-30 19:07:37 +0000 |
---|---|---|
committer | Omar Polo <op@omarpolo.com> | 2021-04-30 19:07:37 +0000 |
commit | 737a6b50c599460a5e69c8a89e41f9881ff07f88 (patch) | |
tree | 7d6bb9326bb8934b7b6dbbcd2ceccc8fc8830b42 /server.c | |
parent | fdea6aa0bca24f6f947e2126ce101fd59caa7a31 (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.c | 2 |
1 files changed, 2 insertions, 0 deletions
@@ -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': |