Module Name: src
Committed By: christos
Date: Wed Oct 16 17:26:14 UTC 2013
Modified Files:
src/usr.sbin/mtree: spec.c
Log Message:
Default a bare "." with no type to F_DIR. For FreeBSD compatibility (Brooks
Davis)
To generate a diff of this commit:
cvs rdiff -u -r1.86 -r1.87 src/usr.sbin/mtree/spec.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/usr.sbin/mtree/spec.c
diff -u src/usr.sbin/mtree/spec.c:1.86 src/usr.sbin/mtree/spec.c:1.87
--- src/usr.sbin/mtree/spec.c:1.86 Mon Sep 9 19:27:43 2013
+++ src/usr.sbin/mtree/spec.c Wed Oct 16 13:26:14 2013
@@ -1,4 +1,4 @@
-/* $NetBSD: spec.c,v 1.86 2013/09/09 23:27:43 christos Exp $ */
+/* $NetBSD: spec.c,v 1.87 2013/10/16 17:26:14 christos Exp $ */
/*-
* Copyright (c) 1989, 1993
@@ -67,7 +67,7 @@
#if 0
static char sccsid[] = "@(#)spec.c 8.2 (Berkeley) 4/28/95";
#else
-__RCSID("$NetBSD: spec.c,v 1.86 2013/09/09 23:27:43 christos Exp $");
+__RCSID("$NetBSD: spec.c,v 1.87 2013/10/16 17:26:14 christos Exp $");
#endif
#endif /* not lint */
@@ -217,6 +217,12 @@ noparent: mtree_err("no parent node");
/*
* empty tree
*/
+ /*
+ * Allow a bare "." root node by forcing it to
+ * type=dir for compatibility with FreeBSD.
+ */
+ if (strcmp(centry->name, ".") == 0 && centry->type == 0)
+ centry->type = F_DIR;
if (strcmp(centry->name, ".") != 0 ||
centry->type != F_DIR)
mtree_err(