Module Name: src Committed By: martin Date: Thu Sep 23 10:04:53 UTC 2021
Modified Files: src/bin/mkdir [netbsd-8]: mkdir.c Log Message: Pull up following revision(s) (requested by kre in ticket #1697): bin/mkdir/mkdir.c: revision 1.39 PR bin/56398 The final component of both a/b/c and a/b/c/ is "c", so that's the one to which the -m arg applies. To generate a diff of this commit: cvs rdiff -u -r1.38 -r1.38.36.1 src/bin/mkdir/mkdir.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/bin/mkdir/mkdir.c diff -u src/bin/mkdir/mkdir.c:1.38 src/bin/mkdir/mkdir.c:1.38.36.1 --- src/bin/mkdir/mkdir.c:1.38 Mon Aug 29 14:45:28 2011 +++ src/bin/mkdir/mkdir.c Thu Sep 23 10:04:53 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: mkdir.c,v 1.38 2011/08/29 14:45:28 joerg Exp $ */ +/* $NetBSD: mkdir.c,v 1.38.36.1 2021/09/23 10:04:53 martin Exp $ */ /* * Copyright (c) 1983, 1992, 1993 @@ -39,7 +39,7 @@ __COPYRIGHT("@(#) Copyright (c) 1983, 19 #if 0 static char sccsid[] = "@(#)mkdir.c 8.2 (Berkeley) 1/25/94"; #else -__RCSID("$NetBSD: mkdir.c,v 1.38 2011/08/29 14:45:28 joerg Exp $"); +__RCSID("$NetBSD: mkdir.c,v 1.38.36.1 2021/09/23 10:04:53 martin Exp $"); #endif #endif /* not lint */ @@ -162,7 +162,7 @@ mkpath(char *path, mode_t mode, mode_t d slash += strspn(slash, "/"); slash += strcspn(slash, "/"); - done = (*slash == '\0'); + done = (*(slash + strspn(slash, "/")) == '\0'); *slash = '\0'; rv = mkdir(path, done ? mode : dir_mode);