summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--curl-config.in4
-rwxr-xr-xtests/libtest/test1022.pl17
2 files changed, 15 insertions, 6 deletions
diff --git a/curl-config.in b/curl-config.in
index 27b9f7ffe..023280303 100644
--- a/curl-config.in
+++ b/curl-config.in
@@ -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
;;
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$//;