summaryrefslogtreecommitdiff
path: root/usr.sbin/mtree
diff options
context:
space:
mode:
Diffstat (limited to 'usr.sbin/mtree')
-rw-r--r--usr.sbin/mtree/create.c15
-rw-r--r--usr.sbin/mtree/spec.c10
2 files changed, 5 insertions, 20 deletions
diff --git a/usr.sbin/mtree/create.c b/usr.sbin/mtree/create.c
index 47a5e398fef6..af9f50467db9 100644
--- a/usr.sbin/mtree/create.c
+++ b/usr.sbin/mtree/create.c
@@ -36,7 +36,7 @@
static char sccsid[] = "@(#)create.c 8.1 (Berkeley) 6/6/93";
#endif
static const char rcsid[] =
- "$Id: create.c,v 1.12 1999/01/12 02:58:23 jkoshy Exp $";
+ "$Id: create.c,v 1.10 1998/06/05 14:43:39 peter Exp $";
#endif /* not lint */
#include <sys/param.h>
@@ -52,7 +52,6 @@ static const char rcsid[] =
#include <stdio.h>
#include <time.h>
#include <unistd.h>
-#include <vis.h>
#include "mtree.h"
#include "extern.h"
@@ -139,19 +138,11 @@ statf(indent, p)
struct passwd *pw;
u_long len, val;
int fd, offset;
- char *escaped_name;
-
- escaped_name = calloc(1, p->fts_namelen * 4 + 1);
- if (escaped_name == NULL)
- errx(1, "statf(): calloc() failed");
- strvis(escaped_name, p->fts_name, VIS_WHITE | VIS_OCTAL);
if (iflag || S_ISDIR(p->fts_statp->st_mode))
- offset = printf("%*s%s", indent, "", escaped_name);
+ offset = printf("%*s%s", indent, "", p->fts_name);
else
- offset = printf("%*s %s", indent, "", escaped_name);
-
- free(escaped_name);
+ offset = printf("%*s %s", indent, "", p->fts_name);
if (offset > (INDENTNAMELEN + indent))
offset = MAXLINELEN;
diff --git a/usr.sbin/mtree/spec.c b/usr.sbin/mtree/spec.c
index 1e9c5fd47e89..77f54b199334 100644
--- a/usr.sbin/mtree/spec.c
+++ b/usr.sbin/mtree/spec.c
@@ -36,7 +36,7 @@
static char sccsid[] = "@(#)spec.c 8.1 (Berkeley) 6/6/93";
#endif
static const char rcsid[] =
- "$Id: spec.c,v 1.8 1998/12/16 04:54:08 imp Exp $";
+ "$Id$";
#endif /* not lint */
#include <sys/types.h>
@@ -49,7 +49,6 @@ static const char rcsid[] =
#include <pwd.h>
#include <stdio.h>
#include <unistd.h>
-#include <vis.h>
#include "mtree.h"
#include "extern.h"
@@ -144,14 +143,10 @@ noparent: errx(1, "line %d: no parent node", lineno);
if ((centry = calloc(1, sizeof(NODE) + strlen(p))) == NULL)
errx(1, "calloc");
*centry = ginfo;
+ (void)strcpy(centry->name, p);
#define MAGIC "?*["
if (strpbrk(p, MAGIC))
centry->flags |= F_MAGIC;
- if (strunvis(centry->name, p) == -1) {
- warnx("filename %s is ill-encoded and literally used",
- p);
- strcpy(centry->name, p);
- }
set(NULL, centry);
if (!root) {
@@ -217,7 +212,6 @@ set(t, ip)
errx(1, "line %d: invalid file mode %s",
lineno, val);
ip->st_mode = getmode(m, 0);
- free(m);
break;
case F_NLINK:
ip->st_nlink = strtoul(val, &ep, 10);