From c46888b76fe1cb4762dfef960331ad812c82ca5a Mon Sep 17 00:00:00 2001 From: Jamie Cameron Date: Mon, 29 Dec 2008 18:54:08 +0000 Subject: [PATCH] Perl doesn't allow last in a do loop --- postgresql/postgresql-lib.pl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/postgresql/postgresql-lib.pl b/postgresql/postgresql-lib.pl index 0cbd60265..7c8c81af7 100644 --- a/postgresql/postgresql-lib.pl +++ b/postgresql/postgresql-lib.pl @@ -398,7 +398,7 @@ else { (!&supports_pgpass() ? " -u" : " -U $postgres_login"). " -c "."e_path($sql)." $host $_[0]"; if ($postgres_sameunix && defined(getpwnam($postgres_login))) { - $cmd = "su $postgres_login -c ".quotemeta($cmd); + $cmd = &command_as_user($postgres_login, 0, $cmd); } $cmd = &command_with_login($cmd); @@ -419,9 +419,9 @@ else { local ($line, $rv, @data); do { $line = ; - last if (!defined($line)); } while($line =~ /^(username|password|user name):/i || - $line =~ /(warning|notice):/i || $line !~ /\S/); + $line =~ /(warning|notice):/i || + $line !~ /\S/ && defined($line)); unlink($temp); if ($line =~ /^ERROR:\s+(.*)/ || $line =~ /FATAL.*:\s+(.*)/) { &error(&text('esql', "$sql", "$1"));