1 #include "../git-compat-util.h"
4 /* for platforms that can't deal with a trailing '/' */
5 int compat_mkdir_wo_trailing_slash(const char *dir
, mode_t mode
)
9 size_t len
= strlen(dir
);
11 if (len
&& dir
[len
-1] == '/') {
12 if ((tmp_dir
= strdup(dir
)) == NULL
)
14 tmp_dir
[len
-1] = '\0';
17 tmp_dir
= (char *)dir
;
19 retval
= mkdir(tmp_dir
, mode
);