diff options
author | rgrimes <rgrimes@FreeBSD.org> | 1994-09-18 21:17:40 +0000 |
---|---|---|
committer | rgrimes <rgrimes@FreeBSD.org> | 1994-09-18 21:17:40 +0000 |
commit | b98c90be2e4e7635f6a431fe21bd5927a850b840 (patch) | |
tree | cec1784f94e1baa76dfd3637e01e44d44396d0a6 /usr.sbin/mtree/mtree.c | |
parent | 10e98516daf367390bc752990d2da01ac56b167a (diff) | |
download | FreeBSD-src-b98c90be2e4e7635f6a431fe21bd5927a850b840.zip FreeBSD-src-b98c90be2e4e7635f6a431fe21bd5927a850b840.tar.gz |
1. Remove commented out CFLAGS+=-DDEBUG from Makefile
2. Clean up code so it compiles -Wall (except for sccsid's and copyright).
This included fixing several printf formats that where not correct,
and changing the data types of a few things.
3. Implement new option -i that produces indented mtree output files.
4. Implement new option -n that turns off directory comments.
5. Only emit /set records if something has changed since the last one.
Diffstat (limited to 'usr.sbin/mtree/mtree.c')
-rw-r--r-- | usr.sbin/mtree/mtree.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/usr.sbin/mtree/mtree.c b/usr.sbin/mtree/mtree.c index 17857c5..9f5aad6 100644 --- a/usr.sbin/mtree/mtree.c +++ b/usr.sbin/mtree/mtree.c @@ -50,10 +50,10 @@ static char sccsid[] = "@(#)mtree.c 8.1 (Berkeley) 6/6/93"; #include "mtree.h" #include "extern.h" -extern int crc_total; +extern long int crc_total; int ftsoptions = FTS_PHYSICAL; -int cflag, dflag, eflag, rflag, sflag, uflag; +int cflag, dflag, eflag, iflag, nflag, rflag, sflag, uflag; u_short keys; char fullpath[MAXPATHLEN]; @@ -71,7 +71,7 @@ main(argc, argv) dir = NULL; keys = KEYDEFAULT; - while ((ch = getopt(argc, argv, "cdef:K:k:p:rs:ux")) != EOF) + while ((ch = getopt(argc, argv, "cdef:iK:k:np:rs:ux")) != EOF) switch((char)ch) { case 'c': cflag = 1; @@ -86,6 +86,9 @@ main(argc, argv) if (!(freopen(optarg, "r", stdin))) err("%s: %s", optarg, strerror(errno)); break; + case 'i': + iflag = 1; + break; case 'K': while ((p = strsep(&optarg, " \t,")) != NULL) if (*p != '\0') @@ -97,6 +100,9 @@ main(argc, argv) if (*p != '\0') keys |= parsekey(p, NULL); break; + case 'n': + nflag = 1; + break; case 'p': dir = optarg; break; @@ -141,6 +147,6 @@ static void usage() { (void)fprintf(stderr, -"usage: mtree [-cderux] [-f spec] [-K key] [-k key] [-p path] [-s seed]\n"); +"usage: mtree [-cdeinrux] [-f spec] [-K key] [-k key] [-p path] [-s seed]\n"); exit(1); } |