Deleted Added
full compact
spec.c (41848) spec.c (42561)
1/*-
2 * Copyright (c) 1989, 1993
3 * The Regents of the University of California. All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 22 unchanged lines hidden (view full) ---

31 * SUCH DAMAGE.
32 */
33
34#ifndef lint
35#if 0
36static char sccsid[] = "@(#)spec.c 8.1 (Berkeley) 6/6/93";
37#endif
38static const char rcsid[] =
1/*-
2 * Copyright (c) 1989, 1993
3 * The Regents of the University of California. All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 22 unchanged lines hidden (view full) ---

31 * SUCH DAMAGE.
32 */
33
34#ifndef lint
35#if 0
36static char sccsid[] = "@(#)spec.c 8.1 (Berkeley) 6/6/93";
37#endif
38static const char rcsid[] =
39 "$Id: spec.c,v 1.7 1997/10/01 06:30:02 charnier Exp $";
39 "$Id: spec.c,v 1.8 1998/12/16 04:54:08 imp Exp $";
40#endif /* not lint */
41
42#include <sys/types.h>
43#include <sys/stat.h>
44#include <ctype.h>
45#include <err.h>
46#include <errno.h>
47#include <fts.h>
48#include <grp.h>
49#include <pwd.h>
50#include <stdio.h>
51#include <unistd.h>
40#endif /* not lint */
41
42#include <sys/types.h>
43#include <sys/stat.h>
44#include <ctype.h>
45#include <err.h>
46#include <errno.h>
47#include <fts.h>
48#include <grp.h>
49#include <pwd.h>
50#include <stdio.h>
51#include <unistd.h>
52#include <vis.h>
52#include "mtree.h"
53#include "extern.h"
54
55int lineno; /* Current spec line number. */
56
57static void set __P((char *, NODE *));
58static void unset __P((char *, NODE *));
59

--- 78 unchanged lines hidden (view full) ---

138 continue;
139
140noparent: errx(1, "line %d: no parent node", lineno);
141 }
142
143 if ((centry = calloc(1, sizeof(NODE) + strlen(p))) == NULL)
144 errx(1, "calloc");
145 *centry = ginfo;
53#include "mtree.h"
54#include "extern.h"
55
56int lineno; /* Current spec line number. */
57
58static void set __P((char *, NODE *));
59static void unset __P((char *, NODE *));
60

--- 78 unchanged lines hidden (view full) ---

139 continue;
140
141noparent: errx(1, "line %d: no parent node", lineno);
142 }
143
144 if ((centry = calloc(1, sizeof(NODE) + strlen(p))) == NULL)
145 errx(1, "calloc");
146 *centry = ginfo;
146 (void)strcpy(centry->name, p);
147#define MAGIC "?*["
148 if (strpbrk(p, MAGIC))
149 centry->flags |= F_MAGIC;
147#define MAGIC "?*["
148 if (strpbrk(p, MAGIC))
149 centry->flags |= F_MAGIC;
150 if (strunvis(centry->name, p) == -1) {
151 warnx("filename %s is ill-encoded and literally used",
152 p);
153 strcpy(centry->name, p);
154 }
150 set(NULL, centry);
151
152 if (!root) {
153 last = root = centry;
154 root->parent = root;
155 } else if (last->type == F_DIR && !(last->flags & F_DONE)) {
156 centry->parent = last;
157 last = last->child = centry;

--- 143 unchanged lines hidden ---
155 set(NULL, centry);
156
157 if (!root) {
158 last = root = centry;
159 root->parent = root;
160 } else if (last->type == F_DIR && !(last->flags & F_DONE)) {
161 centry->parent = last;
162 last = last->child = centry;

--- 143 unchanged lines hidden ---