2008-07-20 05:20:21 +04:00
|
|
|
/* $NetBSD: main.c,v 1.33 2008/07/20 01:20:23 lukem Exp $ */
|
1995-03-18 17:54:19 +03:00
|
|
|
|
1993-03-21 12:45:37 +03:00
|
|
|
/*
|
1994-06-08 23:27:32 +04:00
|
|
|
* Copyright (c) 1983, 1993
|
|
|
|
* The Regents of the University of California. All rights reserved.
|
1993-03-21 12:45:37 +03:00
|
|
|
*
|
|
|
|
* Redistribution and use in source and binary forms, with or without
|
|
|
|
* modification, are permitted provided that the following conditions
|
|
|
|
* are met:
|
|
|
|
* 1. Redistributions of source code must retain the above copyright
|
|
|
|
* notice, this list of conditions and the following disclaimer.
|
|
|
|
* 2. Redistributions in binary form must reproduce the above copyright
|
|
|
|
* notice, this list of conditions and the following disclaimer in the
|
|
|
|
* documentation and/or other materials provided with the distribution.
|
2003-08-07 14:04:22 +04:00
|
|
|
* 3. Neither the name of the University nor the names of its contributors
|
1993-03-21 12:45:37 +03:00
|
|
|
* may be used to endorse or promote products derived from this software
|
|
|
|
* without specific prior written permission.
|
|
|
|
*
|
|
|
|
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
|
|
|
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
|
|
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
|
|
|
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
|
|
|
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
|
|
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
|
|
|
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
|
|
|
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
|
|
|
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
|
|
|
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
|
|
|
* SUCH DAMAGE.
|
|
|
|
*/
|
|
|
|
|
1997-09-15 12:04:28 +04:00
|
|
|
#include <sys/cdefs.h>
|
1993-03-21 12:45:37 +03:00
|
|
|
#ifndef lint
|
2008-07-20 05:20:21 +04:00
|
|
|
__COPYRIGHT("@(#) Copyright (c) 1983, 1993\
|
|
|
|
The Regents of the University of California. All rights reserved.");
|
1993-03-21 12:45:37 +03:00
|
|
|
#endif /* not lint */
|
|
|
|
|
|
|
|
#ifndef lint
|
1995-03-18 17:54:19 +03:00
|
|
|
#if 0
|
1997-09-16 17:44:12 +04:00
|
|
|
static char sccsid[] = "@(#)main.c 8.6 (Berkeley) 5/4/95";
|
1995-03-18 17:54:19 +03:00
|
|
|
#else
|
2008-07-20 05:20:21 +04:00
|
|
|
__RCSID("$NetBSD: main.c,v 1.33 2008/07/20 01:20:23 lukem Exp $");
|
1995-03-18 17:54:19 +03:00
|
|
|
#endif
|
1993-03-21 12:45:37 +03:00
|
|
|
#endif /* not lint */
|
|
|
|
|
1993-12-22 13:31:38 +03:00
|
|
|
#include <sys/param.h>
|
|
|
|
#include <sys/time.h>
|
1993-03-21 12:45:37 +03:00
|
|
|
|
1994-06-08 23:27:32 +04:00
|
|
|
#include <ufs/ufs/dinode.h>
|
1997-09-16 17:44:12 +04:00
|
|
|
#include <ufs/ffs/fs.h>
|
1993-03-21 12:45:37 +03:00
|
|
|
#include <protocols/dumprestore.h>
|
1993-12-22 13:31:38 +03:00
|
|
|
|
1994-06-08 23:27:32 +04:00
|
|
|
#include <err.h>
|
1993-12-22 13:31:38 +03:00
|
|
|
#include <errno.h>
|
1997-04-15 11:12:19 +04:00
|
|
|
#include <paths.h>
|
1993-12-22 13:31:38 +03:00
|
|
|
#include <signal.h>
|
|
|
|
#include <stdio.h>
|
|
|
|
#include <stdlib.h>
|
|
|
|
#include <string.h>
|
1997-09-16 17:44:12 +04:00
|
|
|
#include <unistd.h>
|
1993-12-22 13:31:38 +03:00
|
|
|
|
|
|
|
#include "restore.h"
|
|
|
|
#include "extern.h"
|
1993-03-21 12:45:37 +03:00
|
|
|
|
|
|
|
int bflag = 0, cvtflag = 0, dflag = 0, vflag = 0, yflag = 0;
|
2004-07-27 06:17:06 +04:00
|
|
|
int hflag = 1, mflag = 1, Dflag = 0, Nflag = 0;
|
1993-03-21 12:45:37 +03:00
|
|
|
char command = '\0';
|
1997-09-15 12:04:28 +04:00
|
|
|
int32_t dumpnum = 1;
|
|
|
|
int32_t volno = 0;
|
|
|
|
int32_t ntrec;
|
1993-03-21 12:45:37 +03:00
|
|
|
char *dumpmap;
|
1994-12-28 05:21:43 +03:00
|
|
|
char *usedinomap;
|
1993-03-21 12:45:37 +03:00
|
|
|
ino_t maxino;
|
|
|
|
time_t dumptime;
|
|
|
|
time_t dumpdate;
|
2002-11-18 07:28:03 +03:00
|
|
|
size_t pagesize;
|
2004-07-27 06:20:56 +04:00
|
|
|
FILE *terminal;
|
2005-06-27 05:55:52 +04:00
|
|
|
const char *tmpdir;
|
2005-01-08 17:30:39 +03:00
|
|
|
int dotflag = 0;
|
1993-03-21 12:45:37 +03:00
|
|
|
|
2004-10-23 02:38:38 +04:00
|
|
|
FILE *Mtreefile = NULL;
|
|
|
|
|
2005-02-17 18:00:33 +03:00
|
|
|
static void obsolete(int *, char **[]);
|
|
|
|
static void usage(void);
|
1993-12-22 13:31:38 +03:00
|
|
|
|
|
|
|
int
|
2005-02-17 18:00:33 +03:00
|
|
|
main(int argc, char *argv[])
|
1993-03-21 12:45:37 +03:00
|
|
|
{
|
1993-12-22 13:31:38 +03:00
|
|
|
int ch;
|
1993-03-21 12:45:37 +03:00
|
|
|
ino_t ino;
|
2005-06-27 05:55:52 +04:00
|
|
|
const char *inputdev;
|
|
|
|
const char *symtbl = "./restoresymtable";
|
1993-12-22 13:31:38 +03:00
|
|
|
char *p, name[MAXPATHLEN];
|
2005-06-27 05:55:52 +04:00
|
|
|
static char dot[] = ".";
|
1993-03-21 12:45:37 +03:00
|
|
|
|
1993-12-22 13:31:38 +03:00
|
|
|
if (argc < 2)
|
|
|
|
usage();
|
|
|
|
|
1996-02-06 03:00:22 +03:00
|
|
|
if ((inputdev = getenv("TAPE")) == NULL)
|
|
|
|
inputdev = _PATH_DEFTAPE;
|
1997-07-01 09:37:49 +04:00
|
|
|
if ((tmpdir = getenv("TMPDIR")) == NULL)
|
|
|
|
tmpdir = _PATH_TMP;
|
1993-12-22 13:31:38 +03:00
|
|
|
obsolete(&argc, &argv);
|
2004-10-23 02:38:38 +04:00
|
|
|
while ((ch = getopt(argc, argv, "b:cD:df:himM:NRrs:tuvxy")) != -1)
|
2004-07-27 06:20:56 +04:00
|
|
|
switch (ch) {
|
1993-12-22 13:31:38 +03:00
|
|
|
case 'b':
|
|
|
|
/* Change default tape blocksize. */
|
|
|
|
bflag = 1;
|
|
|
|
ntrec = strtol(optarg, &p, 10);
|
|
|
|
if (*p)
|
1994-06-08 23:27:32 +04:00
|
|
|
errx(1, "illegal blocksize -- %s", optarg);
|
1993-12-22 13:31:38 +03:00
|
|
|
if (ntrec <= 0)
|
1994-06-08 23:27:32 +04:00
|
|
|
errx(1, "block size must be greater than 0");
|
1993-03-21 12:45:37 +03:00
|
|
|
break;
|
|
|
|
case 'c':
|
1993-12-22 13:31:38 +03:00
|
|
|
cvtflag = 1;
|
1993-03-21 12:45:37 +03:00
|
|
|
break;
|
2004-07-27 06:17:06 +04:00
|
|
|
case 'D':
|
|
|
|
ddesc = digest_lookup(optarg);
|
|
|
|
if (ddesc == NULL)
|
|
|
|
err(1, "unknown digest algorithm: %s", optarg);
|
|
|
|
Dflag = 1;
|
|
|
|
break;
|
1993-03-21 12:45:37 +03:00
|
|
|
case 'd':
|
1993-12-22 13:31:38 +03:00
|
|
|
dflag = 1;
|
|
|
|
break;
|
|
|
|
case 'f':
|
|
|
|
inputdev = optarg;
|
1993-03-21 12:45:37 +03:00
|
|
|
break;
|
|
|
|
case 'h':
|
|
|
|
hflag = 0;
|
|
|
|
break;
|
1993-12-22 13:31:38 +03:00
|
|
|
case 'i':
|
|
|
|
case 'R':
|
|
|
|
case 'r':
|
|
|
|
case 't':
|
|
|
|
case 'x':
|
|
|
|
if (command != '\0')
|
1994-06-08 23:27:32 +04:00
|
|
|
errx(1,
|
|
|
|
"%c and %c options are mutually exclusive",
|
1993-12-22 13:31:38 +03:00
|
|
|
ch, command);
|
|
|
|
command = ch;
|
|
|
|
break;
|
1993-03-21 12:45:37 +03:00
|
|
|
case 'm':
|
|
|
|
mflag = 0;
|
|
|
|
break;
|
|
|
|
case 'N':
|
1993-12-22 13:31:38 +03:00
|
|
|
Nflag = 1;
|
|
|
|
break;
|
2004-10-23 02:38:38 +04:00
|
|
|
case 'M':
|
|
|
|
Mtreefile = fopen(optarg, "a");
|
|
|
|
if (Mtreefile == NULL)
|
|
|
|
err(1, "can't open %s", optarg);
|
|
|
|
break;
|
1993-12-22 13:31:38 +03:00
|
|
|
case 's':
|
|
|
|
/* Dumpnum (skip to) for multifile dump tapes. */
|
|
|
|
dumpnum = strtol(optarg, &p, 10);
|
|
|
|
if (*p)
|
1994-06-08 23:27:32 +04:00
|
|
|
errx(1, "illegal dump number -- %s", optarg);
|
1993-12-22 13:31:38 +03:00
|
|
|
if (dumpnum <= 0)
|
1994-06-08 23:27:32 +04:00
|
|
|
errx(1, "dump number must be greater than 0");
|
1993-03-21 12:45:37 +03:00
|
|
|
break;
|
1998-06-24 23:56:11 +04:00
|
|
|
case 'u':
|
|
|
|
uflag = 1;
|
|
|
|
break;
|
1993-03-21 12:45:37 +03:00
|
|
|
case 'v':
|
1993-12-22 13:31:38 +03:00
|
|
|
vflag = 1;
|
1993-03-21 12:45:37 +03:00
|
|
|
break;
|
|
|
|
case 'y':
|
1993-12-22 13:31:38 +03:00
|
|
|
yflag = 1;
|
1993-03-21 12:45:37 +03:00
|
|
|
break;
|
|
|
|
default:
|
1993-12-22 13:31:38 +03:00
|
|
|
usage();
|
1993-03-21 12:45:37 +03:00
|
|
|
}
|
1993-12-22 13:31:38 +03:00
|
|
|
argc -= optind;
|
|
|
|
argv += optind;
|
|
|
|
|
|
|
|
if (command == '\0')
|
1994-06-08 23:27:32 +04:00
|
|
|
errx(1, "none of i, R, r, t or x options specified");
|
1993-12-22 13:31:38 +03:00
|
|
|
|
2000-06-09 13:05:02 +04:00
|
|
|
if (Nflag || command == 't')
|
|
|
|
uflag = 0;
|
|
|
|
|
1993-12-22 13:31:38 +03:00
|
|
|
if (signal(SIGINT, onintr) == SIG_IGN)
|
|
|
|
(void) signal(SIGINT, SIG_IGN);
|
|
|
|
if (signal(SIGTERM, onintr) == SIG_IGN)
|
|
|
|
(void) signal(SIGTERM, SIG_IGN);
|
|
|
|
setlinebuf(stderr);
|
2002-11-18 07:28:03 +03:00
|
|
|
pagesize = sysconf(_SC_PAGESIZE);
|
1993-12-22 13:31:38 +03:00
|
|
|
|
1995-02-20 22:43:51 +03:00
|
|
|
atexit(cleanup);
|
|
|
|
|
1993-03-21 12:45:37 +03:00
|
|
|
setinput(inputdev);
|
1993-12-22 13:31:38 +03:00
|
|
|
|
1993-03-21 12:45:37 +03:00
|
|
|
if (argc == 0) {
|
|
|
|
argc = 1;
|
2005-06-27 05:55:52 +04:00
|
|
|
*--argv = dot;
|
1993-03-21 12:45:37 +03:00
|
|
|
}
|
1993-12-22 13:31:38 +03:00
|
|
|
|
1993-03-21 12:45:37 +03:00
|
|
|
switch (command) {
|
|
|
|
/*
|
|
|
|
* Interactive mode.
|
|
|
|
*/
|
|
|
|
case 'i':
|
|
|
|
setup();
|
|
|
|
extractdirs(1);
|
1993-12-22 13:31:38 +03:00
|
|
|
initsymtable(NULL);
|
1993-03-21 12:45:37 +03:00
|
|
|
runcmdshell();
|
1993-12-22 13:31:38 +03:00
|
|
|
break;
|
1993-03-21 12:45:37 +03:00
|
|
|
/*
|
|
|
|
* Incremental restoration of a file system.
|
|
|
|
*/
|
|
|
|
case 'r':
|
|
|
|
setup();
|
|
|
|
if (dumptime > 0) {
|
|
|
|
/*
|
|
|
|
* This is an incremental dump tape.
|
|
|
|
*/
|
|
|
|
vprintf(stdout, "Begin incremental restore\n");
|
|
|
|
initsymtable(symtbl);
|
|
|
|
extractdirs(1);
|
|
|
|
removeoldleaves();
|
|
|
|
vprintf(stdout, "Calculate node updates.\n");
|
|
|
|
treescan(".", ROOTINO, nodeupdates);
|
|
|
|
findunreflinks();
|
|
|
|
removeoldnodes();
|
|
|
|
} else {
|
|
|
|
/*
|
|
|
|
* This is a level zero dump tape.
|
|
|
|
*/
|
|
|
|
vprintf(stdout, "Begin level 0 restore\n");
|
|
|
|
initsymtable((char *)0);
|
|
|
|
extractdirs(1);
|
|
|
|
vprintf(stdout, "Calculate extraction list.\n");
|
|
|
|
treescan(".", ROOTINO, nodeupdates);
|
|
|
|
}
|
|
|
|
createleaves(symtbl);
|
|
|
|
createlinks();
|
1993-12-22 13:31:38 +03:00
|
|
|
setdirmodes(FORCE);
|
1993-03-21 12:45:37 +03:00
|
|
|
checkrestore();
|
|
|
|
if (dflag) {
|
|
|
|
vprintf(stdout, "Verify the directory structure\n");
|
|
|
|
treescan(".", ROOTINO, verifyfile);
|
|
|
|
}
|
|
|
|
dumpsymtable(symtbl, (long)1);
|
1993-12-22 13:31:38 +03:00
|
|
|
break;
|
1993-03-21 12:45:37 +03:00
|
|
|
/*
|
|
|
|
* Resume an incremental file system restoration.
|
|
|
|
*/
|
|
|
|
case 'R':
|
|
|
|
initsymtable(symtbl);
|
|
|
|
skipmaps();
|
|
|
|
skipdirs();
|
|
|
|
createleaves(symtbl);
|
|
|
|
createlinks();
|
1993-12-22 13:31:38 +03:00
|
|
|
setdirmodes(FORCE);
|
1993-03-21 12:45:37 +03:00
|
|
|
checkrestore();
|
|
|
|
dumpsymtable(symtbl, (long)1);
|
1993-12-22 13:31:38 +03:00
|
|
|
break;
|
1993-03-21 12:45:37 +03:00
|
|
|
/*
|
|
|
|
* List contents of tape.
|
|
|
|
*/
|
|
|
|
case 't':
|
|
|
|
setup();
|
|
|
|
extractdirs(0);
|
|
|
|
initsymtable((char *)0);
|
|
|
|
while (argc--) {
|
|
|
|
canon(*argv++, name);
|
|
|
|
ino = dirlookup(name);
|
|
|
|
if (ino == 0)
|
|
|
|
continue;
|
|
|
|
treescan(name, ino, listfile);
|
|
|
|
}
|
1993-12-22 13:31:38 +03:00
|
|
|
break;
|
1993-03-21 12:45:37 +03:00
|
|
|
/*
|
|
|
|
* Batch extraction of tape contents.
|
|
|
|
*/
|
|
|
|
case 'x':
|
|
|
|
setup();
|
|
|
|
extractdirs(1);
|
|
|
|
initsymtable((char *)0);
|
|
|
|
while (argc--) {
|
|
|
|
canon(*argv++, name);
|
|
|
|
ino = dirlookup(name);
|
|
|
|
if (ino == 0)
|
|
|
|
continue;
|
2005-01-08 17:30:39 +03:00
|
|
|
if (ino == ROOTINO)
|
|
|
|
dotflag = 1;
|
1993-03-21 12:45:37 +03:00
|
|
|
if (mflag)
|
|
|
|
pathcheck(name);
|
|
|
|
treescan(name, ino, addfile);
|
|
|
|
}
|
|
|
|
createfiles();
|
|
|
|
createlinks();
|
1993-12-22 13:31:38 +03:00
|
|
|
setdirmodes(0);
|
1993-03-21 12:45:37 +03:00
|
|
|
if (dflag)
|
|
|
|
checkrestore();
|
1993-12-22 13:31:38 +03:00
|
|
|
break;
|
|
|
|
}
|
1995-02-20 22:43:51 +03:00
|
|
|
exit(0);
|
1993-12-22 13:31:38 +03:00
|
|
|
/* NOTREACHED */
|
|
|
|
}
|
|
|
|
|
1994-06-08 23:27:32 +04:00
|
|
|
static void
|
2005-02-17 18:00:33 +03:00
|
|
|
usage(void)
|
1993-12-22 13:31:38 +03:00
|
|
|
{
|
2001-02-20 01:48:57 +03:00
|
|
|
const char *progname = getprogname();
|
1995-02-21 04:17:40 +03:00
|
|
|
|
1997-07-06 12:51:28 +04:00
|
|
|
(void)fprintf(stderr,
|
2004-07-27 18:20:11 +04:00
|
|
|
"usage: %s -i [-cdhmvyN] [-b bsize] [-D algorithm] "
|
2004-10-24 21:01:07 +04:00
|
|
|
"[-f file] [-M mtreefile] [-s fileno]\n", progname);
|
1997-07-06 12:51:28 +04:00
|
|
|
(void)fprintf(stderr,
|
2004-07-27 18:20:11 +04:00
|
|
|
" %s -R [-cdvyN] [-b bsize] [-D algorithm] [-f file] "
|
2004-10-24 21:01:07 +04:00
|
|
|
"[-M mtreefile] [-s fileno]\n", progname);
|
1997-07-06 12:51:28 +04:00
|
|
|
(void)fprintf(stderr,
|
2004-07-27 18:20:11 +04:00
|
|
|
" %s -r [-cdvyN] [-b bsize] [-D algorithm] [-f file] "
|
2004-10-24 21:01:07 +04:00
|
|
|
"[-M mtreefile] [-s fileno]\n", progname);
|
1997-07-06 12:51:28 +04:00
|
|
|
(void)fprintf(stderr,
|
2004-07-27 18:20:11 +04:00
|
|
|
" %s -t [-cdhvy] [-b bsize] [-D algorithm] [-f file]\n"
|
|
|
|
" [-s fileno] [file ...]\n", progname);
|
1997-07-06 12:51:28 +04:00
|
|
|
(void)fprintf(stderr,
|
2004-07-27 18:20:11 +04:00
|
|
|
" %s -x [-cdhmvyN] [-b bsize] [-D algorithm] [-f file]\n"
|
2004-10-24 21:01:07 +04:00
|
|
|
" [-M mtreefile] [-s fileno] [file ...]\n", progname);
|
1995-02-20 22:43:51 +03:00
|
|
|
exit(1);
|
1993-12-22 13:31:38 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* obsolete --
|
|
|
|
* Change set of key letters and ordered arguments into something
|
|
|
|
* getopt(3) will like.
|
|
|
|
*/
|
|
|
|
static void
|
2005-02-17 18:00:33 +03:00
|
|
|
obsolete(int *argcp, char **argvp[])
|
1993-12-22 13:31:38 +03:00
|
|
|
{
|
|
|
|
int argc, flags;
|
|
|
|
char *ap, **argv, *flagsp, **nargv, *p;
|
|
|
|
|
|
|
|
/* Setup. */
|
|
|
|
argv = *argvp;
|
|
|
|
argc = *argcp;
|
|
|
|
|
|
|
|
/* Return if no arguments or first argument has leading dash. */
|
|
|
|
ap = argv[1];
|
|
|
|
if (argc == 1 || *ap == '-')
|
|
|
|
return;
|
|
|
|
|
|
|
|
/* Allocate space for new arguments. */
|
|
|
|
if ((*argvp = nargv = malloc((argc + 1) * sizeof(char *))) == NULL ||
|
|
|
|
(p = flagsp = malloc(strlen(ap) + 2)) == NULL)
|
1999-11-09 18:06:30 +03:00
|
|
|
err(1, NULL);
|
1993-12-22 13:31:38 +03:00
|
|
|
|
|
|
|
*nargv++ = *argv;
|
|
|
|
argv += 2;
|
|
|
|
|
|
|
|
for (flags = 0; *ap; ++ap) {
|
1995-02-20 21:42:14 +03:00
|
|
|
switch (*ap) {
|
1993-12-22 13:31:38 +03:00
|
|
|
case 'b':
|
|
|
|
case 'f':
|
|
|
|
case 's':
|
1995-02-20 21:42:14 +03:00
|
|
|
if (*argv == NULL) {
|
|
|
|
warnx("option requires an argument -- %c", *ap);
|
|
|
|
usage();
|
|
|
|
}
|
1993-12-22 13:31:38 +03:00
|
|
|
if ((nargv[0] = malloc(strlen(*argv) + 2 + 1)) == NULL)
|
1999-11-09 18:06:30 +03:00
|
|
|
err(1, NULL);
|
1993-12-22 13:31:38 +03:00
|
|
|
nargv[0][0] = '-';
|
|
|
|
nargv[0][1] = *ap;
|
|
|
|
(void)strcpy(&nargv[0][2], *argv);
|
1995-02-20 21:42:14 +03:00
|
|
|
++argv;
|
1993-12-22 13:31:38 +03:00
|
|
|
++nargv;
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
if (!flags) {
|
|
|
|
*p++ = '-';
|
|
|
|
flags = 1;
|
|
|
|
}
|
|
|
|
*p++ = *ap;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Terminate flags. */
|
|
|
|
if (flags) {
|
|
|
|
*p = '\0';
|
|
|
|
*nargv++ = flagsp;
|
2006-03-20 04:51:54 +03:00
|
|
|
} else {
|
|
|
|
free(flagsp);
|
1993-03-21 12:45:37 +03:00
|
|
|
}
|
1993-12-22 13:31:38 +03:00
|
|
|
|
|
|
|
/* Copy remaining arguments. */
|
1997-07-06 12:51:28 +04:00
|
|
|
while ((*nargv++ = *argv++) != NULL)
|
|
|
|
;
|
1995-02-20 21:42:14 +03:00
|
|
|
|
|
|
|
/* Update argument count. */
|
|
|
|
*argcp = nargv - *argvp - 1;
|
1993-03-21 12:45:37 +03:00
|
|
|
}
|