]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/extra/pgsql_config.pl
This is better now.
[user/henk/code/inspircd.git] / src / modules / extra / pgsql_config.pl
index 9b09aef91fa8b4946ea99bdfb40a744664c07e13..277a4f71da431ba99e25851940f41061fac7ad75 100644 (file)
@@ -1,6 +1,6 @@
 #!/usr/bin/perl
 
-my $v = substr(`pg_config --version`, 11);
-my($a, $b, $c) = split(/\./, $v);
-
-print "-D PGSQL_HAS_ESCAPECONN" if((($a = 8) and ($b >= 1) and ($c >= 4)) or ($a > 8));
+my $s = `pg_config --version`;
+$s =~ /^.*?(\d+)\.(\d+)\.(\d+).*?$/;
+my $v = hex(sprintf("0x%02x%02x%02x", $1, $2, $3));
+print "-DPGSQL_HAS_ESCAPECONN" if(($v >= 0x080104) or (($v >= 0x07030F) and ($v < 0x080000)));