diff options
Diffstat (limited to 'src/libs6f')
| -rw-r--r-- | src/libs6f/deps-lib/s6f | 1 | ||||
| -rw-r--r-- | src/libs6f/s6f_equote.c | 24 | ||||
| -rw-r--r-- | src/libs6f/s6f_user_get_confdirs.c | 2 |
3 files changed, 26 insertions, 1 deletions
diff --git a/src/libs6f/deps-lib/s6f b/src/libs6f/deps-lib/s6f index 464cc81..b1d1ddb 100644 --- a/src/libs6f/deps-lib/s6f +++ b/src/libs6f/deps-lib/s6f @@ -1,4 +1,5 @@ s6f_confdir_open.o +s6f_equote.o s6f_lock.o s6f_report_state_change.o s6f_user_get_confdirs.o diff --git a/src/libs6f/s6f_equote.c b/src/libs6f/s6f_equote.c new file mode 100644 index 0000000..41cef42 --- /dev/null +++ b/src/libs6f/s6f_equote.c @@ -0,0 +1,24 @@ +/* ISC license. */ + +#include <string.h> + +#include "s6f.h" + +size_t s6f_equote_space (char const *const *argv, unsigned int argc) +{ + size_t l = 0 ; + for (unsigned int i = 0 ; i < argc ; i++) l += i + 2 + strlen(argv[i]) ; + return l ; +} + +unsigned int s6f_equote (char const **newargv, char const *const *argv, unsigned int argc, char *s) +{ + for (unsigned int i = 0 ; i < argc ; i++) + { + newargv[i] = s ; + *s++ = ' ' ; + s = stpcpy(s, argv[i]) + 1 ; + } + newargv[argc] = "" ; + return argc + 1 ; +} diff --git a/src/libs6f/s6f_user_get_confdirs.c b/src/libs6f/s6f_user_get_confdirs.c index b062650..5617bf9 100644 --- a/src/libs6f/s6f_user_get_confdirs.c +++ b/src/libs6f/s6f_user_get_confdirs.c @@ -68,7 +68,7 @@ void s6f_user_get_confdirs (s6f_confdirs *dirs, stralloc *storage) bootpos = storage->len ; if (!(confighome ? stralloc_cats(storage, confighome) : stralloc_cats(storage, home) && stralloc_cats(storage, "/.config")) - || !stralloc_cats(storage, "/s6-rc") + || !stralloc_cats(storage, "/s6-rc/compiled/current") || !stralloc_0(storage)) dienomem() ; stmppos = storage->len ; |
