diff mbox series

[iproute2,v5,3/7] configure: fix parsing issue with more than one value per option

Message ID 59c4edf70811ab7589d453f8652eb206e1aac5aa.1634199240.git.aclaudi@redhat.com (mailing list archive)
State Accepted
Delegated to: David Ahern
Headers show
Series configure: add support for libdir option | expand

Checks

Context Check Description
netdev/tree_selection success Not a local patch

Commit Message

Andrea Claudi Oct. 14, 2021, 8:50 a.m. UTC
With commit a9c3d70d902a ("configure: add options ability") users are no
more able to provide wrong command lines like:

$ ./configure --include_dir foo bar

The script simply bails out when user provides more than one value for a
single option. However, in doing so, it breaks backward compatibility with
some packaging system, which expects unknown options to be ignored.

Commit a3272b93725a ("configure: restore backward compatibility") fix this
issue, but makes it possible again for users to provide wrong command lines
such as the one above.

This fixes the issue simply ignoring autoconf-like options such as
'--opt=value'.

Fixes: a3272b93725a ("configure: restore backward compatibility")
Signed-off-by: Andrea Claudi <aclaudi@redhat.com>
---
 configure | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/configure b/configure
index 0f304206..9ec19a5b 100755
--- a/configure
+++ b/configure
@@ -517,10 +517,12 @@  else
 				shift 2 ;;
 			-h | --help)
 				usage 0 ;;
+			--*)
+				shift ;;
 			"")
 				break ;;
 			*)
-				shift 1 ;;
+				usage 1 ;;
 		esac
 	done
 fi