From b98c90be2e4e7635f6a431fe21bd5927a850b840 Mon Sep 17 00:00:00 2001 From: rgrimes Date: Sun, 18 Sep 1994 21:17:40 +0000 Subject: 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. --- usr.sbin/mtree/spec.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'usr.sbin/mtree/spec.c') diff --git a/usr.sbin/mtree/spec.c b/usr.sbin/mtree/spec.c index a50574f..a2c5171 100644 --- a/usr.sbin/mtree/spec.c +++ b/usr.sbin/mtree/spec.c @@ -61,7 +61,7 @@ spec() int c_cur, c_next; char buf[2048]; - root = NULL; + centry = last = root = NULL; bzero(&ginfo, sizeof(ginfo)); c_cur = c_next = 0; for (lineno = 1; fgets(buf, sizeof(buf), stdin); @@ -164,14 +164,14 @@ set(t, ip) register NODE *ip; { register int type; - register char *kw, *val; + register char *kw, *val = NULL; struct group *gr; struct passwd *pw; mode_t *m; int value; char *ep; - for (; kw = strtok(t, "= \t\n"); t = NULL) { + for (; (kw = strtok(t, "= \t\n")); t = NULL) { ip->flags |= type = parsekey(kw, &value); if (value && (val = strtok(NULL, " \t\n")) == NULL) err("missing value"); @@ -275,6 +275,6 @@ unset(t, ip) { register char *p; - while (p = strtok(t, "\n\t ")) + while ((p = strtok(t, "\n\t "))) ip->flags &= ~parsekey(p, NULL); } -- cgit v1.1