From ec63698ce2acba9c5e8040c32a0317ca1037b124 Mon Sep 17 00:00:00 2001 From: jozan Date: Sun, 15 Nov 2020 18:22:15 +0000 Subject: no chdir, yeye FossilOrigin-Name: fb7c8f30bd334f8b102126291f7a115647566f90c0a5e8212beac3504599f307 --- src/u_utils.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'src/u_utils.c') diff --git a/src/u_utils.c b/src/u_utils.c index 8555710..54b7916 100644 --- a/src/u_utils.c +++ b/src/u_utils.c @@ -210,37 +210,37 @@ u_get_nargv(struct opts_s* opts) } void -u_increase_subpath -(char subp[], +u_inc_path +(char path[], const char newp[]) { strlcpy( - subp + strlen(subp), + path + strlen(path), newp, - MAXPATHLEN - strlen(subp) - 1 + MAXPATHLEN - strlen(path) - 1 ); - subp[strlen(subp) + 1] = 0x00; - subp[strlen(subp)] = '/'; + path[strlen(path) + 1] = 0x00; + path[strlen(path)] = '/'; } void -u_decrease_subpath(char subp[]) +u_dec_path(char path[]) { char* p; - p = subp; - p += strlen(subp); + p = path; + p += strlen(path); if (p == 0) { return; } p -= 2; - while (subp - p != 0 && *p != '/') { + while (path - p != 0 && *p != '/') { p--; } if (*p == '/') { *(p + 1) = 0x00; } - else if (subp - p == 0) { + else if (path - p == 0) { *p = 0x00; } } -- cgit v1.2.3