summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorGerrit Pape <pape@smarden.org>2008-04-20 20:38:57 +0000
committerGerrit Pape <pape@smarden.org>2008-04-20 20:38:57 +0000
commited673f8f525aead9418d34faea94b83c71b4eaa7 (patch)
treece3dd102dc86c70d1b28b6563386c6b3e3aa32c6 /src
parent1e83f029d97222fdbda1a26a920199528e72e72d (diff)
downloadrunit-ed673f8f525aead9418d34faea94b83c71b4eaa7.tar.gz
runit-ed673f8f525aead9418d34faea94b83c71b4eaa7.tar.xz
runit-ed673f8f525aead9418d34faea94b83c71b4eaa7.zip
sv.c: service name is also relative to the current directory if it ends with a slash.
Diffstat (limited to 'src')
-rw-r--r--src/sv.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/sv.c b/src/sv.c
index 855ae39..0559abe 100644
--- a/src/sv.c
+++ b/src/sv.c
@@ -331,7 +331,8 @@ int main(int argc, char **argv) {
 
   servicex =service;
   for (i =0; i < services; ++i) {
-    if ((**service != '/') && (**service != '.')) {
+    if ((**service != '/') && (**service != '.') && **service &&
+        ((*service)[str_len(*service) -1] != '/')) {
       if ((chdir(varservice) == -1) || (chdir(*service) == -1)) {
         fail("unable to change to service directory");
         *service =0;