Do not add a separator for empty paths.
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Change-Id: Icec7b07d7abab4c010706c8cb4f199229fa04c6f
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
char count_str[MAX_INT_DEC_LEN(count) + 1] = {};
const char *path_separator;
- if (path_name && path_name[strlen(path_name) - 1] == '/') {
+ if (path_name && (path_name[0] == '\0' ||
+ path_name[strlen(path_name) - 1] == '/')) {
path_separator = "";
} else {
path_separator = "/";