From 142640c5deafc861062095c3a0e91148d11b0a17 Mon Sep 17 00:00:00 2001 From: phk Date: Thu, 8 Jan 2004 22:21:45 +0000 Subject: Do not emit comments when -n is specified. --- usr.sbin/mtree/create.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'usr.sbin/mtree') 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; -- cgit v1.1