Skip to content
Snippets Groups Projects
Commit 82ecc85d authored by Daniel Stenberg's avatar Daniel Stenberg
Browse files

curl-config: fix --version

curl-config --version didn't output the correct version string (bug
introduced in commit 0355e33b), 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
parent 84f809e7
No related branches found
No related tags found
No related merge requests found
......@@ -6,7 +6,7 @@
# | (__| |_| | _ <| |___
# \___|\___/|_| \_\_____|
#
# Copyright (C) 2001 - 2010, Daniel Stenberg, <daniel@haxx.se>, et al.
# Copyright (C) 2001 - 2011, Daniel Stenberg, <daniel@haxx.se>, et al.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution. The terms
......@@ -94,7 +94,7 @@ while test $# -gt 0; do
;;
--version)
echo libcurl @VERSION@
echo libcurl @CURLVERSION@
exit 0
;;
......
......@@ -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$//;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment