Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/bin/mkdir PR bin/56398



details:   https://anonhg.NetBSD.org/src/rev/1783ccd3e3de
branches:  trunk
changeset: 1023543:1783ccd3e3de
user:      kre <kre%NetBSD.org@localhost>
date:      Mon Sep 13 22:46:02 2021 +0000

description:
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.

diffstat:

 bin/mkdir/mkdir.c |  6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diffs (27 lines):

diff -r 82e0e0dd67aa -r 1783ccd3e3de bin/mkdir/mkdir.c
--- a/bin/mkdir/mkdir.c Mon Sep 13 22:09:06 2021 +0000
+++ b/bin/mkdir/mkdir.c Mon Sep 13 22:46:02 2021 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: mkdir.c,v 1.38 2011/08/29 14:45:28 joerg Exp $ */
+/* $NetBSD: mkdir.c,v 1.39 2021/09/13 22:46:02 kre Exp $ */
 
 /*
  * Copyright (c) 1983, 1992, 1993
@@ -39,7 +39,7 @@
 #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.39 2021/09/13 22:46:02 kre Exp $");
 #endif
 #endif /* not lint */
 
@@ -162,7 +162,7 @@
                slash += strspn(slash, "/");
                slash += strcspn(slash, "/");
 
-               done = (*slash == '\0');
+               done = (*(slash + strspn(slash, "/")) == '\0');
                *slash = '\0';
 
                rv = mkdir(path, done ? mode : dir_mode);



Home | Main Index | Thread Index | Old Index