summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorTodd C. Miller <millert@cvs.openbsd.org>2001-05-26 00:32:22 +0000
committerTodd C. Miller <millert@cvs.openbsd.org>2001-05-26 00:32:22 +0000
commit7c9baf59207d20bdbda9b4ce92974c7a849bd103 (patch)
treebb08ade769166bc003208b6bd049100313d14f77 /bin
parent1b2966f9449cb2e15cc400e0c3e2d2e69a42135b (diff)
Get rid of NET2_FTS and NET2_REGEX #ifdefs since they are useless.
Change NET2_STAT into LONG_OFF_T for portability to systems with a 32bit off_t.
Diffstat (limited to 'bin')
-rw-r--r--bin/pax/Makefile23
-rw-r--r--bin/pax/ar_io.c8
-rw-r--r--bin/pax/cache.c12
-rw-r--r--bin/pax/cpio.c14
-rw-r--r--bin/pax/extern.h4
-rw-r--r--bin/pax/ftree.c29
-rw-r--r--bin/pax/gen_subs.c10
-rw-r--r--bin/pax/options.c6
-rw-r--r--bin/pax/pat_rep.c103
-rw-r--r--bin/pax/pat_rep.h6
-rw-r--r--bin/pax/sel_subs.c12
-rw-r--r--bin/pax/tar.c16
12 files changed, 43 insertions, 200 deletions
diff --git a/bin/pax/Makefile b/bin/pax/Makefile
index e8affe51ff5..9ea2e86dcc6 100644
--- a/bin/pax/Makefile
+++ b/bin/pax/Makefile
@@ -1,28 +1,15 @@
-# $OpenBSD: Makefile,v 1.9 1997/09/21 11:35:28 deraadt Exp $
+# $OpenBSD: Makefile,v 1.10 2001/05/26 00:32:20 millert Exp $
# To install on versions prior to BSD 4.4 the following may have to be
# defined with CFLAGS +=
#
-# -DNET2_STAT Use NET2 or older stat structure. The version of the
-# stat structure is easily determined by looking at the
-# basic type of an off_t (often defined in the file:
-# /usr/include/sys/types.h). If off_t is a long (and is
-# NOT A quad) then you must define NET2_STAT.
+# -DLONG_OFF_T Define this if the base type of an off_t is a long (and is
+# NOT a quad). (This is often defined in the file
+# /usr/include/sys/types.h).
# This define is important, as if you do have a quad_t
-# off_t and define NET2_STAT, pax will compile but will
+# off_t and define LONG_OFF_T, pax will compile but will
# NOT RUN PROPERLY.
#
-# -DNET2_FTS Use the older NET2 fts. To identify the version,
-# examine the file: /usr/include/fts.h. If FTS_COMFOLLOW
-# is not defined then you must define NET2_FTS.
-# Pax may not compile if this not (un)defined properly.
-#
-# -DNET2_REGEX Use the older regexp.h not regex.h. The regex version
-# is determined by looking at the value returned by
-# regexec() (man 3 regexec). If regexec return a 1 for
-# success (and NOT a 0 for success) you have the older
-# regex routines and must define NET2_REGEX.
-# Pax may not compile if this not (un)defined properly.
PROG= pax
SRCS= ar_io.c ar_subs.c buf_subs.c cache.c cpio.c file_subs.c ftree.c\
diff --git a/bin/pax/ar_io.c b/bin/pax/ar_io.c
index a67a4f8d80e..f27243f7020 100644
--- a/bin/pax/ar_io.c
+++ b/bin/pax/ar_io.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ar_io.c,v 1.21 2001/05/16 03:04:54 mickey Exp $ */
+/* $OpenBSD: ar_io.c,v 1.22 2001/05/26 00:32:20 millert Exp $ */
/* $NetBSD: ar_io.c,v 1.5 1996/03/26 23:54:13 mrg Exp $ */
/*-
@@ -42,7 +42,7 @@
#if 0
static char sccsid[] = "@(#)ar_io.c 8.2 (Berkeley) 4/18/94";
#else
-static char rcsid[] = "$OpenBSD: ar_io.c,v 1.21 2001/05/16 03:04:54 mickey Exp $";
+static char rcsid[] = "$OpenBSD: ar_io.c,v 1.22 2001/05/26 00:32:20 millert Exp $";
#endif
#endif /* not lint */
@@ -398,7 +398,7 @@ ar_close()
* could have written anything yet.
*/
if (frmt == NULL) {
-# ifdef NET2_STAT
+# ifdef LONG_OFF_T
(void)fprintf(listf, "%s: unknown format, %lu bytes skipped.\n",
# else
(void)fprintf(listf, "%s: unknown format, %qu bytes skipped.\n",
@@ -413,7 +413,7 @@ ar_close()
(void)fprintf(listf, "%qu blocks\n", (rdcnt ? rdcnt : wrcnt) / 5120);
else if (strcmp(NM_TAR, argv0) != 0)
(void)fprintf(listf,
-# ifdef NET2_STAT
+# ifdef LONG_OFF_T
"%s: %s vol %d, %lu files, %lu bytes read, %lu bytes written.\n",
# else
"%s: %s vol %d, %lu files, %qu bytes read, %qu bytes written.\n",
diff --git a/bin/pax/cache.c b/bin/pax/cache.c
index c994383c8cd..9475638f0c8 100644
--- a/bin/pax/cache.c
+++ b/bin/pax/cache.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: cache.c,v 1.7 1999/04/08 03:50:58 deraadt Exp $ */
+/* $OpenBSD: cache.c,v 1.8 2001/05/26 00:32:21 millert Exp $ */
/* $NetBSD: cache.c,v 1.4 1995/03/21 09:07:10 cgd Exp $ */
/*-
@@ -42,7 +42,7 @@
#if 0
static char sccsid[] = "@(#)cache.c 8.1 (Berkeley) 5/31/93";
#else
-static char rcsid[] = "$OpenBSD: cache.c,v 1.7 1999/04/08 03:50:58 deraadt Exp $";
+static char rcsid[] = "$OpenBSD: cache.c,v 1.8 2001/05/26 00:32:21 millert Exp $";
#endif
#endif /* not lint */
@@ -246,12 +246,8 @@ name_uid(uid, frc)
return("");
ptr->uid = uid;
ptr->valid = INVALID;
-# ifdef NET2_STAT
- (void)snprintf(ptr->name, sizeof(ptr->name), "%u", uid);
-# else
(void)snprintf(ptr->name, sizeof(ptr->name), "%lu",
(unsigned long)uid);
-# endif
if (frc == 0)
return("");
} else {
@@ -324,12 +320,8 @@ name_gid(gid, frc)
return("");
ptr->gid = gid;
ptr->valid = INVALID;
-# ifdef NET2_STAT
- (void)snprintf(ptr->name, sizeof(ptr->name), "%u", gid);
-# else
(void)snprintf(ptr->name, sizeof(ptr->name), "%lu",
(unsigned long)gid);
-# endif
if (frc == 0)
return("");
} else {
diff --git a/bin/pax/cpio.c b/bin/pax/cpio.c
index 03d955b4571..e70955d5df2 100644
--- a/bin/pax/cpio.c
+++ b/bin/pax/cpio.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: cpio.c,v 1.6 2001/05/16 03:04:56 mickey Exp $ */
+/* $OpenBSD: cpio.c,v 1.7 2001/05/26 00:32:21 millert Exp $ */
/* $NetBSD: cpio.c,v 1.5 1995/03/21 09:07:13 cgd Exp $ */
/*-
@@ -42,7 +42,7 @@
#if 0
static char sccsid[] = "@(#)cpio.c 8.1 (Berkeley) 5/31/93";
#else
-static char rcsid[] = "$OpenBSD: cpio.c,v 1.6 2001/05/16 03:04:56 mickey Exp $";
+static char rcsid[] = "$OpenBSD: cpio.c,v 1.7 2001/05/26 00:32:21 millert Exp $";
#endif
#endif /* not lint */
@@ -258,7 +258,7 @@ rd_ln_nm(arcn)
*/
if ((arcn->sb.st_size == 0) ||
(arcn->sb.st_size >= sizeof(arcn->ln_name))) {
-# ifdef NET2_STAT
+# ifdef LONG_OFF_T
paxwarn(1, "Cpio link name length is invalid: %lu",
arcn->sb.st_size);
# else
@@ -361,7 +361,7 @@ cpio_rd(arcn, buf)
arcn->sb.st_mtime = (time_t)asc_ul(hd->c_mtime, sizeof(hd->c_mtime),
OCT);
arcn->sb.st_ctime = arcn->sb.st_atime = arcn->sb.st_mtime;
-# ifdef NET2_STAT
+# ifdef LONG_OFF_T
arcn->sb.st_size = (off_t)asc_ul(hd->c_filesize,sizeof(hd->c_filesize),
OCT);
# else
@@ -478,7 +478,7 @@ cpio_wr(arcn)
/*
* set data size for file data
*/
-# ifdef NET2_STAT
+# ifdef LONG_OFF_T
if (ul_asc((u_long)arcn->sb.st_size, hd->c_filesize,
sizeof(hd->c_filesize), OCT)) {
# else
@@ -688,7 +688,7 @@ vcpio_rd(arcn, buf)
arcn->sb.st_gid = (gid_t)asc_ul(hd->c_gid, sizeof(hd->c_gid), HEX);
arcn->sb.st_mtime = (time_t)asc_ul(hd->c_mtime,sizeof(hd->c_mtime),HEX);
arcn->sb.st_ctime = arcn->sb.st_atime = arcn->sb.st_mtime;
-# ifdef NET2_STAT
+# ifdef LONG_OFF_T
arcn->sb.st_size = (off_t)asc_ul(hd->c_filesize,
sizeof(hd->c_filesize), HEX);
# else
@@ -845,7 +845,7 @@ vcpio_wr(arcn)
* much to pad.
*/
arcn->pad = VCPIO_PAD(arcn->sb.st_size);
-# ifdef NET2_STAT
+# ifdef LONG_OFF_T
if (ul_asc((u_long)arcn->sb.st_size, hd->c_filesize,
sizeof(hd->c_filesize), HEX)) {
# else
diff --git a/bin/pax/extern.h b/bin/pax/extern.h
index d7c23c4dc52..70f33b1274f 100644
--- a/bin/pax/extern.h
+++ b/bin/pax/extern.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: extern.h,v 1.18 2001/05/16 03:04:56 mickey Exp $ */
+/* $OpenBSD: extern.h,v 1.19 2001/05/26 00:32:21 millert Exp $ */
/* $NetBSD: extern.h,v 1.5 1996/03/26 23:54:16 mrg Exp $ */
/*-
@@ -171,7 +171,7 @@ void ls_list __P((register ARCHD *, time_t, FILE *));
void ls_tty __P((register ARCHD *));
u_long asc_ul __P((register char *, int, register int));
int ul_asc __P((u_long, register char *, register int, register int));
-#ifndef NET2_STAT
+#ifndef LONG_OFF_T
u_quad_t asc_uqd __P((register char *, int, register int));
int uqd_asc __P((u_quad_t, register char *, register int, register int));
#endif
diff --git a/bin/pax/ftree.c b/bin/pax/ftree.c
index 56d5552534b..9754c62e2a3 100644
--- a/bin/pax/ftree.c
+++ b/bin/pax/ftree.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ftree.c,v 1.15 2001/05/19 15:31:20 millert Exp $ */
+/* $OpenBSD: ftree.c,v 1.16 2001/05/26 00:32:21 millert Exp $ */
/* $NetBSD: ftree.c,v 1.4 1995/03/21 09:07:21 cgd Exp $ */
/*-
@@ -42,7 +42,7 @@
#if 0
static char sccsid[] = "@(#)ftree.c 8.2 (Berkeley) 4/18/94";
#else
-static char rcsid[] = "$OpenBSD: ftree.c,v 1.15 2001/05/19 15:31:20 millert Exp $";
+static char rcsid[] = "$OpenBSD: ftree.c,v 1.16 2001/05/26 00:32:21 millert Exp $";
#endif
#endif /* not lint */
@@ -126,11 +126,7 @@ ftree_start()
else
ftsopts |= FTS_PHYSICAL;
if (Hflag)
-# ifdef NET2_FTS
- paxwarn(0, "The -H flag is not supported on this version");
-# else
ftsopts |= FTS_COMFOLLOW;
-# endif
if (Xflag)
ftsopts |= FTS_XDEV;
@@ -430,13 +426,8 @@ next_file(arcn)
* remember to force the time (this is -t on a read
* directory, not a created directory).
*/
-# ifdef NET2_FTS
- if (!tflag || (get_atdir(ftent->fts_statb.st_dev,
- ftent->fts_statb.st_ino, &mtime, &atime) < 0))
-# else
if (!tflag || (get_atdir(ftent->fts_statp->st_dev,
ftent->fts_statp->st_ino, &mtime, &atime) < 0))
-# endif
continue;
set_ftime(ftent->fts_path, mtime, atime, 1);
continue;
@@ -447,28 +438,16 @@ next_file(arcn)
paxwarn(1,"File system cycle found at %s",ftent->fts_path);
continue;
case FTS_DNR:
-# ifdef NET2_FTS
- syswarn(1, errno,
-# else
syswarn(1, ftent->fts_errno,
-# endif
"Unable to read directory %s", ftent->fts_path);
continue;
case FTS_ERR:
-# ifdef NET2_FTS
- syswarn(1, errno,
-# else
syswarn(1, ftent->fts_errno,
-# endif
"File system traversal error");
continue;
case FTS_NS:
case FTS_NSOK:
-# ifdef NET2_FTS
- syswarn(1, errno,
-# else
syswarn(1, ftent->fts_errno,
-# endif
"Unable to access %s", ftent->fts_path);
continue;
}
@@ -481,11 +460,7 @@ next_file(arcn)
arcn->pad = 0;
arcn->ln_nlen = 0;
arcn->ln_name[0] = '\0';
-# ifdef NET2_FTS
- arcn->sb = ftent->fts_statb;
-# else
memcpy(&arcn->sb, ftent->fts_statp, sizeof(arcn->sb));
-# endif
/*
* file type based set up and copy into the arcn struct
diff --git a/bin/pax/gen_subs.c b/bin/pax/gen_subs.c
index 967afe571d1..9d6917d7c91 100644
--- a/bin/pax/gen_subs.c
+++ b/bin/pax/gen_subs.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: gen_subs.c,v 1.10 2001/05/16 03:04:57 mickey Exp $ */
+/* $OpenBSD: gen_subs.c,v 1.11 2001/05/26 00:32:21 millert Exp $ */
/* $NetBSD: gen_subs.c,v 1.5 1995/03/21 09:07:26 cgd Exp $ */
/*-
@@ -42,7 +42,7 @@
#if 0
static char sccsid[] = "@(#)gen_subs.c 8.1 (Berkeley) 5/31/93";
#else
-static char rcsid[] = "$OpenBSD: gen_subs.c,v 1.10 2001/05/16 03:04:57 mickey Exp $";
+static char rcsid[] = "$OpenBSD: gen_subs.c,v 1.11 2001/05/26 00:32:21 millert Exp $";
#endif
#endif /* not lint */
@@ -134,14 +134,14 @@ ls_list(arcn, now, fp)
* print device id's for devices, or sizes for other nodes
*/
if ((arcn->type == PAX_CHR) || (arcn->type == PAX_BLK))
-# ifdef NET2_STAT
+# ifdef LONG_OFF_T
(void)fprintf(fp, "%4u,%4u ", MAJOR(sbp->st_rdev),
# else
(void)fprintf(fp, "%4lu,%4lu ", (unsigned long)MAJOR(sbp->st_rdev),
# endif
(unsigned long)MINOR(sbp->st_rdev));
else {
-# ifdef NET2_STAT
+# ifdef LONG_OFF_T
(void)fprintf(fp, "%9lu ", sbp->st_size);
# else
(void)fprintf(fp, "%9qu ", sbp->st_size);
@@ -315,7 +315,7 @@ ul_asc(val, str, len, base)
return(0);
}
-#ifndef NET2_STAT
+#ifndef LONG_OFF_T
/*
* asc_uqd()
* convert hex/octal character string into a u_quad_t. We do not have to
diff --git a/bin/pax/options.c b/bin/pax/options.c
index c1555ab76fe..46d5f6846fa 100644
--- a/bin/pax/options.c
+++ b/bin/pax/options.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: options.c,v 1.47 2001/02/10 17:21:14 millert Exp $ */
+/* $OpenBSD: options.c,v 1.48 2001/05/26 00:32:21 millert Exp $ */
/* $NetBSD: options.c,v 1.6 1996/03/26 23:54:18 mrg Exp $ */
/*-
@@ -42,7 +42,7 @@
#if 0
static char sccsid[] = "@(#)options.c 8.2 (Berkeley) 4/18/94";
#else
-static char rcsid[] = "$OpenBSD: options.c,v 1.47 2001/02/10 17:21:14 millert Exp $";
+static char rcsid[] = "$OpenBSD: options.c,v 1.48 2001/05/26 00:32:21 millert Exp $";
#endif
#endif /* not lint */
@@ -1480,7 +1480,7 @@ str_offt(val)
char *expr;
off_t num, t;
-# ifdef NET2_STAT
+# ifdef LONG_OFF_T
num = strtol(val, &expr, 0);
if ((num == LONG_MAX) || (num <= 0) || (expr == val))
# else
diff --git a/bin/pax/pat_rep.c b/bin/pax/pat_rep.c
index 447f5ba1daf..26c36c6bc9b 100644
--- a/bin/pax/pat_rep.c
+++ b/bin/pax/pat_rep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pat_rep.c,v 1.12 2001/05/16 03:04:57 mickey Exp $ */
+/* $OpenBSD: pat_rep.c,v 1.13 2001/05/26 00:32:21 millert Exp $ */
/* $NetBSD: pat_rep.c,v 1.4 1995/03/21 09:07:33 cgd Exp $ */
/*-
@@ -42,7 +42,7 @@
#if 0
static char sccsid[] = "@(#)pat_rep.c 8.2 (Berkeley) 4/18/94";
#else
-static char rcsid[] = "$OpenBSD: pat_rep.c,v 1.12 2001/05/16 03:04:57 mickey Exp $";
+static char rcsid[] = "$OpenBSD: pat_rep.c,v 1.13 2001/05/26 00:32:21 millert Exp $";
#endif
#endif /* not lint */
@@ -55,11 +55,7 @@ static char rcsid[] = "$OpenBSD: pat_rep.c,v 1.12 2001/05/16 03:04:57 mickey Exp
#include <unistd.h>
#include <stdlib.h>
#include <errno.h>
-#ifdef NET2_REGEX
-#include <regexp.h>
-#else
#include <regex.h>
-#endif
#include "pax.h"
#include "pat_rep.h"
#include "extern.h"
@@ -82,11 +78,7 @@ static int tty_rename __P((register ARCHD *));
static int fix_path __P((char *, int *, char *, int));
static int fn_match __P((register char *, register char *, char **));
static char * range_match __P((register char *, register int));
-#ifdef NET2_REGEX
-static int resub __P((regexp *, char *, char *, register char *));
-#else
static int resub __P((regex_t *, regmatch_t *, char *, char *, char *));
-#endif
/*
* rep_add()
@@ -116,10 +108,8 @@ rep_add(str)
register char *pt1;
register char *pt2;
register REPLACE *rep;
-# ifndef NET2_REGEX
register int res;
char rebuf[BUFSIZ];
-# endif
/*
* throw out the bad parameters
@@ -148,13 +138,9 @@ rep_add(str)
}
*pt1 = '\0';
-# ifdef NET2_REGEX
- if ((rep->rcmp = regcomp(str+1)) == NULL) {
-# else
if ((res = regcomp(&(rep->rcmp), str+1, 0)) != 0) {
regerror(res, &(rep->rcmp), rebuf, sizeof(rebuf));
paxwarn(1, "%s while compiling regular expression %s", rebuf, str);
-# endif
(void)free((char *)rep);
return(-1);
}
@@ -166,11 +152,7 @@ rep_add(str)
*/
*pt1++ = *str;
if ((pt2 = strchr(pt1, *str)) == NULL) {
-# ifdef NET2_REGEX
- (void)free((char *)rep->rcmp);
-# else
regfree(&(rep->rcmp));
-# endif
(void)free((char *)rep);
paxwarn(1, "Invalid replacement string %s", str);
return(-1);
@@ -195,11 +177,7 @@ rep_add(str)
rep->flgs |= PRNT;
break;
default:
-# ifdef NET2_REGEX
- (void)free((char *)rep->rcmp);
-# else
regfree(&(rep->rcmp));
-# endif
(void)free((char *)rep);
*pt1 = *str;
paxwarn(1, "Invalid replacement string option %s", str);
@@ -955,9 +933,7 @@ rep_name(name, nlen, prnt)
register char *rpt;
register int found = 0;
register int res;
-# ifndef NET2_REGEX
regmatch_t pm[MAXSUBEXP];
-# endif
char nname[PAXPATHLEN+1]; /* final result of all replacements */
char buf1[PAXPATHLEN+1]; /* where we work on the name */
@@ -984,11 +960,7 @@ rep_name(name, nlen, prnt)
* check for a successful substitution, if not go to
* the next pattern, or cleanup if we were global
*/
-# ifdef NET2_REGEX
- if (regexec(pt->rcmp, inpt) == 0)
-# else
if (regexec(&(pt->rcmp), inpt, MAXSUBEXP, pm, 0) != 0)
-# endif
break;
/*
@@ -999,11 +971,7 @@ rep_name(name, nlen, prnt)
* do not create a string too long).
*/
found = 1;
-# ifdef NET2_REGEX
- rpt = pt->rcmp->startp[0];
-# else
rpt = inpt + pm[0].rm_so;
-# endif
while ((inpt < rpt) && (outpt < endpt))
*outpt++ = *inpt++;
@@ -1016,12 +984,8 @@ rep_name(name, nlen, prnt)
* replacement string and place it the prefix in the
* final output. If we have problems, skip it.
*/
-# ifdef NET2_REGEX
- if ((res = resub(pt->rcmp,pt->nstr,outpt,endpt)) < 0) {
-# else
if ((res = resub(&(pt->rcmp),pm,pt->nstr,outpt,endpt))
< 0) {
-# endif
if (prnt)
paxwarn(1, "Replacement name error %s",
name);
@@ -1039,11 +1003,7 @@ rep_name(name, nlen, prnt)
* the final result. Make sure we do not overrun the
* output buffer
*/
-# ifdef NET2_REGEX
- inpt = pt->rcmp->endp[0];
-# else
inpt += pm[0].rm_eo - pm[0].rm_so;
-# endif
if ((outpt == endpt) || (*inpt == '\0'))
break;
@@ -1101,64 +1061,6 @@ rep_name(name, nlen, prnt)
return(0);
}
-#ifdef NET2_REGEX
-/*
- * resub()
- * apply the replacement to the matched expression. expand out the old
- * style ed(1) subexpression expansion.
- * Return:
- * -1 if error, or the number of characters added to the destination.
- */
-
-#ifdef __STDC__
-static int
-resub(regexp *prog, char *src, char *dest, register char *destend)
-#else
-static int
-resub(prog, src, dest, destend)
- regexp *prog;
- char *src;
- char *dest;
- register char *destend;
-#endif
-{
- register char *spt;
- register char *dpt;
- register char c;
- register int no;
- register int len;
-
- spt = src;
- dpt = dest;
- while ((dpt < destend) && ((c = *spt++) != '\0')) {
- if (c == '&')
- no = 0;
- else if ((c == '\\') && (*spt >= '0') && (*spt <= '9'))
- no = *spt++ - '0';
- else {
- if ((c == '\\') && ((*spt == '\\') || (*spt == '&')))
- c = *spt++;
- *dpt++ = c;
- continue;
- }
- if ((prog->startp[no] == NULL) || (prog->endp[no] == NULL) ||
- ((len = prog->endp[no] - prog->startp[no]) <= 0))
- continue;
-
- /*
- * copy the subexpression to the destination.
- * fail if we run out of space or the match string is damaged
- */
- if (len > (destend - dpt))
- return (-1);
- strncpy(dpt, prog->startp[no], len);
- dpt += len;
- }
- return(dpt - dest);
-}
-
-#else
-
/*
* resub()
* apply the replacement to the matched expression. expand out the old
@@ -1233,4 +1135,3 @@ resub(rp, pm, src, dest, destend)
}
return(dpt - dest);
}
-#endif
diff --git a/bin/pax/pat_rep.h b/bin/pax/pat_rep.h
index b41f1e12fc4..9b97d41f8b9 100644
--- a/bin/pax/pat_rep.h
+++ b/bin/pax/pat_rep.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: pat_rep.h,v 1.2 1996/06/23 14:20:38 deraadt Exp $ */
+/* $OpenBSD: pat_rep.h,v 1.3 2001/05/26 00:32:21 millert Exp $ */
/* $NetBSD: pat_rep.h,v 1.3 1995/03/21 09:07:35 cgd Exp $ */
/*-
@@ -45,11 +45,7 @@
*/
typedef struct replace {
char *nstr; /* the new string we will substitute with */
-# ifdef NET2_REGEX
- regexp *rcmp; /* compiled regular expression used to match */
-# else
regex_t rcmp; /* compiled regular expression used to match */
-# endif
int flgs; /* print conversions? global in operation? */
#define PRNT 0x1
#define GLOB 0x2
diff --git a/bin/pax/sel_subs.c b/bin/pax/sel_subs.c
index c5c2253c82c..83cfdd4d2a4 100644
--- a/bin/pax/sel_subs.c
+++ b/bin/pax/sel_subs.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sel_subs.c,v 1.7 1997/08/17 23:05:09 millert Exp $ */
+/* $OpenBSD: sel_subs.c,v 1.8 2001/05/26 00:32:21 millert Exp $ */
/* $NetBSD: sel_subs.c,v 1.5 1995/03/21 09:07:42 cgd Exp $ */
/*-
@@ -42,7 +42,7 @@
#if 0
static char sccsid[] = "@(#)sel_subs.c 8.1 (Berkeley) 5/31/93";
#else
-static char rcsid[] = "$OpenBSD: sel_subs.c,v 1.7 1997/08/17 23:05:09 millert Exp $";
+static char rcsid[] = "$OpenBSD: sel_subs.c,v 1.8 2001/05/26 00:32:21 millert Exp $";
#endif
#endif /* not lint */
@@ -152,11 +152,7 @@ usr_add(str)
}
uid = (uid_t)pw->pw_uid;
} else
-# ifdef NET2_STAT
- uid = (uid_t)atoi(str+1);
-# else
uid = (uid_t)strtoul(str+1, NULL, 10);
-# endif
endpwent();
/*
@@ -265,11 +261,7 @@ grp_add(str)
}
gid = (gid_t)gr->gr_gid;
} else
-# ifdef NET2_STAT
- gid = (gid_t)atoi(str+1);
-# else
gid = (gid_t)strtoul(str+1, NULL, 10);
-# endif
endgrent();
/*
diff --git a/bin/pax/tar.c b/bin/pax/tar.c
index a7486d68188..a576ffd22c2 100644
--- a/bin/pax/tar.c
+++ b/bin/pax/tar.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: tar.c,v 1.17 2001/05/16 03:04:59 mickey Exp $ */
+/* $OpenBSD: tar.c,v 1.18 2001/05/26 00:32:21 millert Exp $ */
/* $NetBSD: tar.c,v 1.5 1995/03/21 09:07:49 cgd Exp $ */
/*-
@@ -42,7 +42,7 @@
#if 0
static char sccsid[] = "@(#)tar.c 8.2 (Berkeley) 4/18/94";
#else
-static char rcsid[] = "$OpenBSD: tar.c,v 1.17 2001/05/16 03:04:59 mickey Exp $";
+static char rcsid[] = "$OpenBSD: tar.c,v 1.18 2001/05/26 00:32:21 millert Exp $";
#endif
#endif /* not lint */
@@ -65,7 +65,7 @@ static char rcsid[] = "$OpenBSD: tar.c,v 1.17 2001/05/16 03:04:59 mickey Exp $";
static u_long tar_chksm __P((register char *, register int));
static char *name_split __P((register char *, register int));
static int ul_oct __P((u_long, register char *, register int, int));
-#ifndef NET2_STAT
+#ifndef LONG_OFF_T
static int uqd_oct __P((u_quad_t, register char *, register int, int));
#endif
@@ -225,7 +225,7 @@ ul_oct(val, str, len, term)
return(0);
}
-#ifndef NET2_STAT
+#ifndef LONG_OFF_T
/*
* uqd_oct()
* convert an u_quad_t to an octal string. one of many oddball field
@@ -462,7 +462,7 @@ tar_rd(arcn, buf)
0xfff);
arcn->sb.st_uid = (uid_t)asc_ul(hd->uid, sizeof(hd->uid), OCT);
arcn->sb.st_gid = (gid_t)asc_ul(hd->gid, sizeof(hd->gid), OCT);
-#ifdef NET2_STAT
+#ifdef LONG_OFF_T
arcn->sb.st_size = (off_t)asc_ul(hd->size, sizeof(hd->size), OCT);
#else
arcn->sb.st_size = (off_t)asc_uqd(hd->size, sizeof(hd->size), OCT);
@@ -672,7 +672,7 @@ tar_wr(arcn)
*/
hd->linkflag = AREGTYPE;
memset(hd->linkname, 0, sizeof(hd->linkname));
-# ifdef NET2_STAT
+# ifdef LONG_OFF_T
if (ul_oct((u_long)arcn->sb.st_size, hd->size,
sizeof(hd->size), 1)) {
# else
@@ -855,7 +855,7 @@ ustar_rd(arcn, buf)
*/
arcn->sb.st_mode = (mode_t)(asc_ul(hd->mode, sizeof(hd->mode), OCT) &
0xfff);
-#ifdef NET2_STAT
+#ifdef LONG_OFF_T
arcn->sb.st_size = (off_t)asc_ul(hd->size, sizeof(hd->size), OCT);
#else
arcn->sb.st_size = (off_t)asc_uqd(hd->size, sizeof(hd->size), OCT);
@@ -1095,7 +1095,7 @@ ustar_wr(arcn)
memset(hd->devmajor, 0, sizeof(hd->devmajor));
memset(hd->devminor, 0, sizeof(hd->devminor));
arcn->pad = TAR_PAD(arcn->sb.st_size);
-# ifdef NET2_STAT
+# ifdef LONG_OFF_T
if (ul_oct((u_long)arcn->sb.st_size, hd->size,
sizeof(hd->size), 3)) {
# else