From 69f4ce553708ee5ce474faaa9c45312f38aad563 Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Sun, 30 Nov 2008 22:38:20 -0800 Subject: send-email: do not reverse the command line arguments The loop picks elements from @ARGV one by one, sifts them into arguments meant for format-patch and the script itself, and pushes them to @files and @rev_list_opts arrays. Pick elements from @ARGV starting at the beginning using shift, instead of at the end using pop, as push appends them to the end of the array. Signed-off-by: Junio C Hamano --- git-send-email.perl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'git-send-email.perl') diff --git a/git-send-email.perl b/git-send-email.perl index 7508f8ff2..3112f769c 100755 --- a/git-send-email.perl +++ b/git-send-email.perl @@ -421,7 +421,7 @@ EOF # Now that all the defaults are set, process the rest of the command line # arguments and collect up the files that need to be processed. my @rev_list_opts; -while (my $f = pop @ARGV) { +while (defined(my $f = shift @ARGV)) { if ($f eq "--") { push @rev_list_opts, "--", @ARGV; @ARGV = (); -- cgit v1.2.1