This program is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the
- Free Software Foundation; either version 2, or (at your option) any later
+ Free Software Foundation; either version 3, or (at your option) any later
version.
This program is distributed in the hope that it will be useful, but
#include <system.h>
#include <fnmatch.h>
-#include <getline.h>
#include <argp.h>
#include <argp-namefrob.h>
#include <argp-fmtstream.h>
N_("exclude directories containing CACHEDIR.TAG"), GRID+1 },
{"exclude-tag", EXCLUDE_TAG_OPTION, N_("FILE"), 0,
N_("exclude contents of directories containing FILE, except"
- " for FILE itself"), GRID+1 },
+ " for FILE itself"), GRID+1 },
{"exclude-tag-under", EXCLUDE_TAG_UNDER_OPTION, N_("FILE"), 0,
N_("exclude everything under directories containing FILE"), GRID+1 },
{"exclude-tag-all", EXCLUDE_TAG_ALL_OPTION, N_("FILE"), 0,
case EXCLUDE_TAG_OPTION:
add_exclusion_tag (arg, exclusion_tag_contents, NULL);
break;
-
+
case EXCLUDE_TAG_UNDER_OPTION:
add_exclusion_tag (arg, exclusion_tag_under, NULL);
break;
-
+
case EXCLUDE_TAG_ALL_OPTION:
add_exclusion_tag (arg, exclusion_tag_all, NULL);
break;
-
+
case FORCE_LOCAL_OPTION:
force_local_option = true;
break;
/* Parse the options for tar. */
static struct argp_option *
-find_argp_option (struct argp_option *options, int letter)
+find_argp_option (struct argp_option *o, int letter)
{
for (;
- !(options->name == NULL
- && options->key == 0
- && options->arg == 0
- && options->flags == 0
- && options->doc == NULL); options++)
- if (options->key == letter)
- return options;
+ !(o->name == NULL
+ && o->key == 0
+ && o->arg == 0
+ && o->flags == 0
+ && o->doc == NULL); o++)
+ if (o->key == letter)
+ return o;
return NULL;
}
static void
decode_options (int argc, char **argv)
{
- int index;
+ int idx;
struct tar_args args;
/* Set some default option values. */
prepend_default_options (getenv ("TAR_OPTIONS"), &argc, &argv);
if (argp_parse (&argp, argc, argv, ARGP_IN_ORDER|ARGP_NO_HELP,
- &index, &args))
+ &idx, &args))
exit (TAREXIT_FAILURE);
}
/* Handle operands after any "--" argument. */
- for (; index < argc; index++)
+ for (; idx < argc; idx++)
{
- name_add_name (argv[index], MAKE_INCL_OPTIONS (&args));
+ name_add_name (argv[idx], MAKE_INCL_OPTIONS (&args));
args.input_files = true;
}
/* Make sure we have first three descriptors available */
stdopen ();
- /* Close all inherited open descriptors, except for the first three */
- closeopen ();
-
/* Pre-allocate a few structures. */
allocated_archive_names = 10;
/* Decode options. */
decode_options (argc, argv);
+
name_init ();
/* Main command execution. */
free (st->gname);
free (st->sparse_map);
free (st->dumpdir);
+ xheader_destroy (&st->xhdr);
memset (st, 0, sizeof (*st));
}