public inbox for [email protected]  
help / color / mirror / Atom feed
From: Noah Misch <[email protected]>
To: Nathan Bossart <[email protected]>
Cc: Michael Paquier <[email protected]>
Cc: Kyotaro Horiguchi <[email protected]>
Cc: [email protected]
Subject: Re: add non-option reordering to in-tree getopt_long
Date: Wed, 14 Jun 2023 15:11:54 -0700
Message-ID: <[email protected]> (raw)
In-Reply-To: <20230614212816.GA492731@nathanxps13>
References: <20230609232257.GA121461@nathanxps13>
	<[email protected]>
	<20230613051343.GA211254@nathanxps13>
	<[email protected]>
	<20230613223657.GC219055@nathanxps13>
	<[email protected]>
	<[email protected]>
	<[email protected]>
	<20230614212816.GA492731@nathanxps13>

On Wed, Jun 14, 2023 at 02:28:16PM -0700, Nathan Bossart wrote:
> On Tue, Jun 13, 2023 at 05:17:37PM -0700, Noah Misch wrote:
> > If you have a test program to be run, I can run it on AIX.
> 
> Thanks.  The patch above [0] adjusts 040_createuser.pl to test modifying
> argv, so that's one test program.  And here's a few lines for reversing
> argv:
> 
> 	#include <stdio.h>
> 
> 	int
> 	main(int argc, char *argv[])
> 	{
> 		for (int i = 0; i < argc / 2; i++)
> 		{
> 			char	   *tmp = argv[i];
> 
> 			argv[i] = argv[argc - i - 1];
> 			argv[argc - i - 1] = tmp;
> 		}
> 
> 		for (int i = 0; i < argc; i++)
> 			printf("%s ", argv[i]);
> 		printf("\n");
> 	}

Here's some output from this program (on AIX 7.1, same output when compiled
32-bit or 64-bit):

$ ./a.out a b c d e f
f e d c b a ./a.out

Interesting discussion here, too:
https://github.com/libuv/libuv/pull/1187






view thread (7+ messages)  latest in thread

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected], [email protected], [email protected], [email protected]
  Subject: Re: add non-option reordering to in-tree getopt_long
  In-Reply-To: <[email protected]>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox