summaryrefslogtreecommitdiffhomepage
path: root/src/nxt_runtime.c
diff options
context:
space:
mode:
authorIgor Sysoev <igor@sysoev.ru>2017-08-30 21:44:39 +0300
committerIgor Sysoev <igor@sysoev.ru>2017-08-30 21:44:39 +0300
commita81257984217a199db1b52377e7b1be5beadd9e9 (patch)
treef1e0160209a332c8e06a91ab0306d558b2a85ea0 /src/nxt_runtime.c
parent740dc67ec844a2606d6d0ac8bb20658a7c9eea42 (diff)
downloadunit-a81257984217a199db1b52377e7b1be5beadd9e9.tar.gz
unit-a81257984217a199db1b52377e7b1be5beadd9e9.tar.bz2
Adding a missing slash to the tail of path set by --modules
command line option.
Diffstat (limited to 'src/nxt_runtime.c')
-rw-r--r--src/nxt_runtime.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/src/nxt_runtime.c b/src/nxt_runtime.c
index 66647225..ad999c88 100644
--- a/src/nxt_runtime.c
+++ b/src/nxt_runtime.c
@@ -705,8 +705,10 @@ static nxt_int_t
nxt_runtime_conf_init(nxt_task_t *task, nxt_runtime_t *rt)
{
nxt_int_t ret;
- nxt_file_t *file;
nxt_str_t control;
+ nxt_uint_t n;
+ nxt_file_t *file;
+ const char *slash;
nxt_sockaddr_t *sa;
nxt_file_name_str_t file_name;
const nxt_event_interface_t *interface;
@@ -754,8 +756,15 @@ nxt_runtime_conf_init(nxt_task_t *task, nxt_runtime_t *rt)
file = nxt_list_first(rt->log_files);
file->name = file_name.start;
- ret = nxt_file_name_create(rt->mem_pool, &file_name, "%snginext.*%Z",
- rt->modules);
+ slash = "";
+ n = nxt_strlen(rt->modules);
+
+ if (n > 1 && rt->modules[n - 1] != '/') {
+ slash = "/";
+ }
+
+ ret = nxt_file_name_create(rt->mem_pool, &file_name, "%s%snginext.*%Z",
+ rt->modules, slash);
if (nxt_slow_path(ret != NXT_OK)) {
return NXT_ERROR;
}