Fix DEFOP botch. DEFOP == LIST so tar -tvf stopped working. (hi soren)

This commit is contained in:
christos 2002-10-17 00:42:02 +00:00
parent 4472ef1520
commit 860d26c69b
3 changed files with 8 additions and 9 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: options.c,v 1.53 2002/10/16 23:37:49 soren Exp $ */ /* $NetBSD: options.c,v 1.54 2002/10/17 00:42:02 christos Exp $ */
/*- /*-
* Copyright (c) 1992 Keith Muller. * Copyright (c) 1992 Keith Muller.
@ -42,7 +42,7 @@
#if 0 #if 0
static char sccsid[] = "@(#)options.c 8.2 (Berkeley) 4/18/94"; static char sccsid[] = "@(#)options.c 8.2 (Berkeley) 4/18/94";
#else #else
__RCSID("$NetBSD: options.c,v 1.53 2002/10/16 23:37:49 soren Exp $"); __RCSID("$NetBSD: options.c,v 1.54 2002/10/17 00:42:02 christos Exp $");
#endif #endif
#endif /* not lint */ #endif /* not lint */
@ -1037,7 +1037,7 @@ tar_options(int argc, char **argv)
argv += optind; argv += optind;
/* Tar requires an action. */ /* Tar requires an action. */
if (act == DEFOP) if (act == ERROR)
tar_usage(); tar_usage();
/* Traditional tar behaviour (pax uses stderr unless in list mode) */ /* Traditional tar behaviour (pax uses stderr unless in list mode) */
@ -1314,7 +1314,6 @@ cpio_options(int argc, char **argv)
pmtime = 0; pmtime = 0;
arcname = NULL; arcname = NULL;
dflag = 1; dflag = 1;
act = -1;
nodirs = 1; nodirs = 1;
/* /*
* process option flags * process option flags

View File

@ -1,4 +1,4 @@
/* $NetBSD: pax.c,v 1.20 2002/10/15 16:16:30 christos Exp $ */ /* $NetBSD: pax.c,v 1.21 2002/10/17 00:42:02 christos Exp $ */
/*- /*-
* Copyright (c) 1992 Keith Muller. * Copyright (c) 1992 Keith Muller.
@ -47,7 +47,7 @@ __COPYRIGHT("@(#) Copyright (c) 1992, 1993\n\
#if 0 #if 0
static char sccsid[] = "@(#)pax.c 8.2 (Berkeley) 4/18/94"; static char sccsid[] = "@(#)pax.c 8.2 (Berkeley) 4/18/94";
#else #else
__RCSID("$NetBSD: pax.c,v 1.20 2002/10/15 16:16:30 christos Exp $"); __RCSID("$NetBSD: pax.c,v 1.21 2002/10/17 00:42:02 christos Exp $");
#endif #endif
#endif /* not lint */ #endif /* not lint */
@ -75,7 +75,7 @@ static int gen_init(void);
/* /*
* Variables that can be accessed by any routine within pax * Variables that can be accessed by any routine within pax
*/ */
int act = DEFOP; /* read/write/append/copy */ int act = ERROR; /* read/write/append/copy */
FSUB *frmt = NULL; /* archive format type */ FSUB *frmt = NULL; /* archive format type */
int cflag; /* match all EXCEPT pattern/file */ int cflag; /* match all EXCEPT pattern/file */
int cwdfd; /* starting cwd */ int cwdfd; /* starting cwd */

View File

@ -1,4 +1,4 @@
/* $NetBSD: pax.h,v 1.16 2002/10/13 00:34:16 mrg Exp $ */ /* $NetBSD: pax.h,v 1.17 2002/10/17 00:42:02 christos Exp $ */
/*- /*-
* Copyright (c) 1992 Keith Muller. * Copyright (c) 1992 Keith Muller.
@ -65,12 +65,12 @@
/* /*
* Pax modes of operation * Pax modes of operation
*/ */
#define ERROR -1 /* nothing selected */
#define LIST 0 /* List the file in an archive */ #define LIST 0 /* List the file in an archive */
#define EXTRACT 1 /* extract the files in an archive */ #define EXTRACT 1 /* extract the files in an archive */
#define ARCHIVE 2 /* write a new archive */ #define ARCHIVE 2 /* write a new archive */
#define APPND 3 /* append to the end of an archive */ #define APPND 3 /* append to the end of an archive */
#define COPY 4 /* copy files to destination dir */ #define COPY 4 /* copy files to destination dir */
#define DEFOP LIST /* if no flags default is to LIST */
/* /*
* Device type of the current archive volume * Device type of the current archive volume