dinitctl: handle service dir with absolute path in enable/disable.
authorDavin McCall <davmac@davmac.org>
Thu, 23 May 2019 11:20:39 +0000 (21:20 +1000)
committerDavin McCall <davmac@davmac.org>
Thu, 23 May 2019 11:20:39 +0000 (21:20 +1000)
src/dinitctl.cc

index ab58177c878bdfd894a09a470d40a0978b151914..d0f9c154f983aa898a8f5e2394dfae11beed530c 100644 (file)
@@ -925,7 +925,7 @@ static int enable_disable_service(int socknum, cpbuffer_t &rbuffer, const char *
     string service_file_path;
 
     for (std::string path : paths) {
-        string test_path = combine_paths(dinit_cwd + '/' + path, from);
+        string test_path = combine_paths(combine_paths(dinit_cwd, path.c_str()), from);
 
         service_file.open(test_path.c_str(), ios::in);
         if (service_file) {