/* ar.c - Archive modify and extract.
- Copyright (C) 1991-2018 Free Software Foundation, Inc.
+ Copyright (C) 1991-2019 Free Software Foundation, Inc.
This file is part of GNU Binutils.
{
int c;
- /* Convert old-style tar call by exploding option element and rearranging
+ /* Convert old-style ar call by exploding option element and rearranging
options accordingly. */
+ restart:
if (argc > 1 && argv[1][0] != '-')
{
int new_argc; /* argc value for rearranged arguments */
}
}
+ /* PR 13256: Allow for the possibility that the first command line option
+ started with a dash (eg --plugin) but then the following option(s) are
+ old style, non-dash-prefixed versions. */
+ if (operation == none && write_armap != 1 && !mri_mode
+ && optind > 0 && optind < argc)
+ {
+ argv += (optind - 1);
+ argc -= (optind - 1);
+ optind = 0;
+ goto restart;
+ }
+
return &argv[optind];
}