diff options
Diffstat (limited to 'gnu/libexec/uucp/libunix/mkdirs.c')
-rw-r--r-- | gnu/libexec/uucp/libunix/mkdirs.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/gnu/libexec/uucp/libunix/mkdirs.c b/gnu/libexec/uucp/libunix/mkdirs.c index 9b5b23f..df4f987 100644 --- a/gnu/libexec/uucp/libunix/mkdirs.c +++ b/gnu/libexec/uucp/libunix/mkdirs.c @@ -28,9 +28,18 @@ fsysdep_make_dirs (zfile, fpublic) { if (*z == '/' && z != zcopy) { + /* Some versions of uuto will send a double slash. Some + systems will fail to create a directory ending in a + slash. */ + if (z[-1] == '/') + continue; *z = '\0'; if (mkdir (zcopy, imode) != 0 && errno != EEXIST + && errno != EISDIR +#ifdef EROFS + && errno != EROFS +#endif && (errno != EACCES || ! fsysdep_directory (zcopy))) { ulog (LOG_ERROR, "mkdir (%s): %s", zcopy, @@ -38,10 +47,7 @@ fsysdep_make_dirs (zfile, fpublic) ubuffree (zcopy); return FALSE; } - *z = '/'; /* replace '/' in its place */ - /* now skips over multiple '/' in name */ - while ( (*(z + 1)) && (*(z + 1)) == '/') - z++; + *z = '/'; } } |