commit fd49d8f5018a552bfec05abdbae0057bd4fc8cfd
parent 72584290a2c0160005846de0e01aadac84c9994b
Author: Gerrit Pape <pape@smarden.org>
Date: Sun, 20 Apr 2008 20:38:57 +0000
sv.c: service name is also relative to the current directory if it ends with a slash.
Diffstat:
3 files changed, 6 insertions(+), 3 deletions(-)
diff --git a/man/sv.8 b/man/sv.8
@@ -28,8 +28,8 @@ used by
.BR runsv (8).
If
.I service
-doesn't start with a dot or slash, it is searched in the default services
-directory
+doesn't start with a dot or slash and doesn't end with a slash, it is
+searched in the default services directory
.IR /var/service/ ,
otherwise relative to the current directory.
.P
diff --git a/package/CHANGES b/package/CHANGES
@@ -1,4 +1,6 @@
* doc/upgrade.html: typo.
+ * sv.c: service name is also relative to the current directory if it
+ ends with a slash.
1.8.0
Fri, 21 Sep 2007 00:33:56 +0000
diff --git 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;