aboutsummaryrefslogtreecommitdiffstats
path: root/src/u_utils.c
diff options
context:
space:
mode:
authorjozan <jozan@noemail.net>2020-11-15 18:22:15 +0000
committerjozan <jozan@noemail.net>2020-11-15 18:22:15 +0000
commitec63698ce2acba9c5e8040c32a0317ca1037b124 (patch)
tree127e0122010b71acbc526741cd645a62ce08b1de /src/u_utils.c
parentCreate new branch named "no-chdir" (diff)
downloadunixize-ec63698ce2acba9c5e8040c32a0317ca1037b124.tar.gz
unixize-ec63698ce2acba9c5e8040c32a0317ca1037b124.tar.bz2
unixize-ec63698ce2acba9c5e8040c32a0317ca1037b124.tar.xz
unixize-ec63698ce2acba9c5e8040c32a0317ca1037b124.tar.zst
unixize-ec63698ce2acba9c5e8040c32a0317ca1037b124.zip
no chdir, yeyeno-chdir
FossilOrigin-Name: fb7c8f30bd334f8b102126291f7a115647566f90c0a5e8212beac3504599f307
Diffstat (limited to 'src/u_utils.c')
-rw-r--r--src/u_utils.c22
1 files changed, 11 insertions, 11 deletions
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;
}
}