aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoseph Hunkeler <jhunkeler@gmail.com>2020-09-01 01:24:43 -0400
committerJoseph Hunkeler <jhunkeler@gmail.com>2020-09-01 01:24:43 -0400
commit33187a7fed578c66559239d71b9164fb857aaa94 (patch)
treee4c743b910fa6754e0e4cccef9b016ebef6f3d42
parent2ecbf55184bf47dfc91ece9ff369789fbf62aa91 (diff)
downloadmultihome-33187a7fed578c66559239d71b9164fb857aaa94.tar.gz
Optimize abspath generation
-rw-r--r--multihome.c7
1 files changed, 1 insertions, 6 deletions
diff --git a/multihome.c b/multihome.c
index e93a9fb..8ef736b 100644
--- a/multihome.c
+++ b/multihome.c
@@ -134,17 +134,12 @@ int mkdirs(char *path) {
size_t parts_length;
memset(tmp, '\0', sizeof(tmp));
- int abspath;
- abspath = path[0] == '/';
parts = split(path, "/", &parts_length);
for (size_t i = 0; parts[i] != NULL; i++) {
if (i == 0 && strlen(parts[i]) == 0) {
- continue;
- }
-
- if (abspath) {
strcat(tmp, "/");
+ continue;
}
strcat(tmp, parts[i]);