}
static
-char *expand_double_slashes_dot_and_dotdot(char *path)
+int expand_double_slashes_dot_and_dotdot(char *path)
{
size_t expanded_path_len, path_len;
const char *curr_char, *path_last_char, *next_slash, *prev_slash;
path_last_char = &path[path_len];
if (path_len == 0) {
- path = NULL;
goto error;
}
}
path[expanded_path_len] = '\0';
-
+ return 0;
error:
- return path;
+ return -1;
}
/*
int ret;
char *absolute_path = NULL;
char *last_token;
- int is_dot, is_dotdot;
+ bool is_dot, is_dotdot;
/* Safety net */
if (path == NULL) {
absolute_path, LTTNG_PATH_MAX);
}
- absolute_path = expand_double_slashes_dot_and_dotdot(absolute_path);
- if (!absolute_path) {
+ ret = expand_double_slashes_dot_and_dotdot(absolute_path);
+ if (ret) {
goto error;
}