mirror of
https://github.com/troglobit/finit.git
synced 2026-11-01 13:10:32 +00:00
paste(): only add '/' if dir and file are missing a '/'
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This commit is contained in:
1 parent
b396a018c5
commit
a69cef0a11
1 file changed
+2
-1
+2
-1
@@ -101,7 +101,8 @@ static inline int paste(char *buf, size_t len, const char *dir, const char *file
|
|||||||
if (!file)
|
if (!file)
|
||||||
file = "";
|
file = "";
|
||||||
|
|
||||||
return snprintf(buf, len, "%s%s%s", dir, fisslashdir(dir) ? "" : "/", file);
|
return snprintf(buf, len, "%s%s%s", dir,
|
||||||
|
fisslashdir(dir) ? "" : file[0] == '/' ? "" : "/", file);
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* FINIT_UTIL_H_ */
|
#endif /* FINIT_UTIL_H_ */
|
||||||
|
|||||||
Reference in new issue
Block a user