diff options
author | Poul-Henning Kamp <phk@FreeBSD.org> | 2004-01-08 22:21:45 +0000 |
---|---|---|
committer | Poul-Henning Kamp <phk@FreeBSD.org> | 2004-01-08 22:21:45 +0000 |
commit | ed283fb5068655fcd5b054645e61fefda42505f1 (patch) | |
tree | b51aa4a23e50b6fba3ab63d0e327e076d5c999b7 /usr.sbin/mtree | |
parent | 65bae14d771082002e13fd64b6a1a793bfa8e259 (diff) | |
download | src-ed283fb5068655fcd5b054645e61fefda42505f1.tar.gz src-ed283fb5068655fcd5b054645e61fefda42505f1.zip |
Do not emit comments when -n is specified.
Notes
Notes:
svn path=/head/; revision=124265
Diffstat (limited to 'usr.sbin/mtree')
-rw-r--r-- | usr.sbin/mtree/create.c | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/usr.sbin/mtree/create.c b/usr.sbin/mtree/create.c index b276cfafe6dc..22f20bcae160 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; |