diff options
author | Daniel Stenberg <daniel@haxx.se> | 2011-04-18 09:03:12 +0200 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2011-04-18 09:03:12 +0200 |
commit | 82ecc85d9ed0fc05931fb6d6893eda567a3c443f (patch) | |
tree | 5c98f1585d22ca7f3ee883b7b5c93b30ad10aad4 /tests/libtest/test1022.pl | |
parent | 84f809e7a872e189bf4105b6e5d175edf6cf19a1 (diff) |
curl-config: fix --version
curl-config --version didn't output the correct version string (bug
introduced in commit 0355e33b5f7b234cf3), and unfortunately the test
case 1022 that was supposed to check for this was broken.
This change fixes the test to detect this problem and it fixes the
output.
Bug: http://curl.haxx.se/bug/view.cgi?id=3288727
Diffstat (limited to 'tests/libtest/test1022.pl')
-rwxr-xr-x | tests/libtest/test1022.pl | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/tests/libtest/test1022.pl b/tests/libtest/test1022.pl index 60eee384c..7fac00e7a 100755 --- a/tests/libtest/test1022.pl +++ b/tests/libtest/test1022.pl @@ -22,14 +22,23 @@ my $curlconfigversion; open(CURLCONFIG, "sh $ARGV[0] --$what|") || die "Can't get curl-config --$what list\n"; $_ = <CURLCONFIG>; chomp; +my $filever=$_; if ( $what eq "version" ) { - /^libcurl ([\.\d]+(-DEV)?)$/ ; - $curlconfigversion = $1; + if($filever =~ /^libcurl ([\.\d]+(-DEV)?)$/) { + $curlconfigversion = $1; + } + else { + $curlconfigversion = "illegal value"; + } } else { # Convert hex version to decimal for comparison's sake - /^(..)(..)(..)$/ ; - $curlconfigversion = hex($1) . "." . hex($2) . "." . hex($3); + if($filever =~ /^(..)(..)(..)$/) { + $curlconfigversion = hex($1) . "." . hex($2) . "." . hex($3); + } + else { + $curlconfigversion = "illegal value"; + } # Strip off the -DEV from the curl version if it's there $version =~ s/-DEV$//; |