Fix mkdir -p with a leading /

This commit is contained in:
sin 2015-04-20 17:39:50 +01:00
parent 9c03736696
commit 6e30efb9bb
2 changed files with 2 additions and 2 deletions

View File

@ -13,4 +13,4 @@ RANLIB = ranlib
# For NetBSD add -D_NETBSD_SOURCE # For NetBSD add -D_NETBSD_SOURCE
CPPFLAGS = -D_DEFAULT_SOURCE -D_BSD_SOURCE -D_XOPEN_SOURCE=700 CPPFLAGS = -D_DEFAULT_SOURCE -D_BSD_SOURCE -D_XOPEN_SOURCE=700
CFLAGS = -std=c99 -Wall -pedantic CFLAGS = -std=c99 -Wall -pedantic
LDFLAGS = -s -lrt LDFLAGS = -s

View File

@ -11,7 +11,7 @@ mkdirp(char *path)
{ {
char *p; char *p;
for (p = path; *p; p++) { for (p = path + (*path == '/'); *p; p++) {
if (*p != '/') if (*p != '/')
continue; continue;
*p = '\0'; *p = '\0';