summaryrefslogtreecommitdiffstats
path: root/usr.sbin/mtree
diff options
context:
space:
mode:
authorphk <phk@FreeBSD.org>2004-01-08 22:21:45 +0000
committerphk <phk@FreeBSD.org>2004-01-08 22:21:45 +0000
commit142640c5deafc861062095c3a0e91148d11b0a17 (patch)
treeb51aa4a23e50b6fba3ab63d0e327e076d5c999b7 /usr.sbin/mtree
parent9f7878e05ab8473614dbd02b348aced4f69c8f39 (diff)
downloadFreeBSD-src-142640c5deafc861062095c3a0e91148d11b0a17.zip
FreeBSD-src-142640c5deafc861062095c3a0e91148d11b0a17.tar.gz
Do not emit comments when -n is specified.
Diffstat (limited to 'usr.sbin/mtree')
-rw-r--r--usr.sbin/mtree/create.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/usr.sbin/mtree/create.c b/usr.sbin/mtree/create.c
index b276cfa..22f20bc 100644
--- a/usr.sbin/mtree/create.c
+++ b/usr.sbin/mtree/create.c
@@ -90,11 +90,16 @@ cwalk(void)
char dot[] = ".";
int indent = 0;
- (void)time(&cl);
- (void)gethostname(host, sizeof(host));
- (void)printf(
- "#\t user: %s\n#\tmachine: %s\n#\t tree: %s\n#\t date: %s",
- getlogin(), host, fullpath, ctime(&cl));
+ if (!nflag) {
+ (void)time(&cl);
+ (void)gethostname(host, sizeof(host));
+ (void)printf(
+ "#\t user: %s\n#\tmachine: %s\n",
+ getlogin(), host);
+ (void)printf(
+ "#\t tree: %s\n#\t date: %s",
+ fullpath, ctime(&cl));
+ }
argv[0] = dot;
argv[1] = NULL;
OpenPOWER on IntegriCloud