PR25079, "ar s" stopped working

Message ID 20191008135604.GP7064@bubble.grove.modra.org
State New
Headers show
Series
  • PR25079, "ar s" stopped working
Related show

Commit Message

Alan Modra Oct. 8, 2019, 1:56 p.m.
's' is both a command and a modifier.  If given as a command then we
aren't lacking an operation.  I think the same goes when mri mode is
selected: any following command line used to be ignored.

	PR 25079
	* ar.c (decode_options): Don't try for command options if
	write_armap or mri_mode is selected.


-- 
Alan Modra
Australia Development Lab, IBM

Patch

diff --git a/binutils/ar.c b/binutils/ar.c
index 6bac862bc7..b99afff1c7 100644
--- a/binutils/ar.c
+++ b/binutils/ar.c
@@ -602,7 +602,8 @@  decode_options (int argc, char **argv)
   /* 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 && optind > 0 && optind < argc)
+  if (operation == none && write_armap != 1 && !mri_mode
+      && optind > 0 && optind < argc)
     {
       argv += (optind - 1);
       argc -= (optind - 1);