[hackers] [sbase] Making `mkdir -p` handle empty paths. Thanks, Willem van de Krol! || David Galos

From: <git_AT_suckless.org>
Date: Fri, 12 Jul 2013 03:43:31 +0200

commit 48e6870bb7aeb00818ba98307f40e6726cd71c61
Author: David Galos <galosd83_AT_students.rowan.edu>
Date: Thu Jul 11 21:43:38 2013 -0400

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

diff --git a/mkdir.c b/mkdir.c
index 89e9ba5..459cae5 100644
--- a/mkdir.c
+++ b/mkdir.c
_AT_@ -46,7 +46,7 @@ mkdirp(char *path)
         char *p = path;
 
         do {
- if((p = strchr(&p[1], '/')))
+ if(*p && (p = strchr(&p[1], '/')))
                         *p = '
Received on Fri Jul 12 2013 - 03:43:31 CEST

This archive was generated by hypermail 2.3.0 : Fri Jul 12 2013 - 03:48:14 CEST