OSDN Git Service

configure: fix non-standard regex used with expr
authorMans Rullgard <mans@mansr.com>
Sun, 13 Feb 2011 21:00:03 +0000 (21:00 +0000)
committerMans Rullgard <mans@mansr.com>
Sun, 13 Feb 2011 21:00:03 +0000 (21:00 +0000)
The colon operator of expr always anchors the pattern at the start
of the string.  An explicit ^ in the pattern has unspecified
behaviour, so remove it.

Signed-off-by: Mans Rullgard <mans@mansr.com>
configure

index 8cf6d4c..90eeaa0 100755 (executable)
--- a/configure
+++ b/configure
@@ -1867,7 +1867,7 @@ elif $cc -v 2>&1 | grep -qi ^gcc; then
     cc_version=__VERSION__
     gcc_version=$($cc --version | head -n1)
     gcc_basever=$($cc -dumpversion)
-    gcc_pkg_ver=$(expr "$gcc_version" : '^[^ ]* \(([^)]*)\)')
+    gcc_pkg_ver=$(expr "$gcc_version" : '[^ ]* \(([^)]*)\)')
     gcc_ext_ver=$(expr "$gcc_version" : ".*$gcc_pkg_ver $gcc_basever \\(.*\\)")
     cc_ident=$(cleanws "gcc $gcc_basever $gcc_pkg_ver $gcc_ext_ver")
     if ! $cc -dumpversion | grep -q '^2\.'; then