X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fmodules%2Fextra%2Fpgsql_config.pl;h=277a4f71da431ba99e25851940f41061fac7ad75;hb=5a88424dbb33ac825aa0b9b6525179329ee75519;hp=9b09aef91fa8b4946ea99bdfb40a744664c07e13;hpb=7639c4bf92149ff65be6e09d6eca5db68debc760;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/modules/extra/pgsql_config.pl b/src/modules/extra/pgsql_config.pl index 9b09aef91..277a4f71d 100644 --- a/src/modules/extra/pgsql_config.pl +++ b/src/modules/extra/pgsql_config.pl @@ -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)));