Making `mkdir -p` handle empty paths. Thanks, Willem van de Krol!

This commit is contained in:
David Galos 2013-07-11 21:43:38 -04:00
parent 7adf4f380a
commit 48e6870bb7
1 changed files with 1 additions and 1 deletions

View File

@ -46,7 +46,7 @@ mkdirp(char *path)
char *p = path;
do {
if((p = strchr(&p[1], '/')))
if(*p && (p = strchr(&p[1], '/')))
*p = '\0';
if(mkdir(path, S_IRWXU|S_IRWXG|S_IRWXO) == -1 && errno != EEXIST)
eprintf("mkdir %s:", path);