1 parent 25b2389 commit 88efbdfCopy full SHA for 88efbdf
2 files changed
src/util.c
@@ -7,7 +7,7 @@
7
char *path_append(const char *path, const char *filename)
8
{
9
int needs_separator = 0;
10
- if (path[strnlen(path, MAX_PATH_LEN)-1] != '/') {
+ if ((path[strnlen(path, MAX_PATH_LEN)-1] != '/') && (filename[0] != '/')) {
11
needs_separator = 1;
12
}
13
src/util.h
@@ -21,6 +21,8 @@
21
* \brief append a path
22
* \details This function appends a path with the next level, while taking the
23
* trailing slash of the upper level into account.
24
+ *
25
+ * Please free the char * pointer after use.
26
*/
27
char *path_append(const char *path, const char *filename);
28
0 commit comments