From fbc0086fcceb3c2a955a74a6efcaae388b6334eb Mon Sep 17 00:00:00 2001 From: Isaac Connor Date: Mon, 8 Aug 2016 16:52:09 -0400 Subject: [PATCH] get the other dbPass use and quote it. Slight visual code style cleanup. --- scripts/zmupdate.pl.in | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/scripts/zmupdate.pl.in b/scripts/zmupdate.pl.in index 462cb1d18..7497309c3 100644 --- a/scripts/zmupdate.pl.in +++ b/scripts/zmupdate.pl.in @@ -412,15 +412,12 @@ if ( $version ) { my ( $host, $port ) = ( $Config{ZM_DB_HOST} =~ /^([^:]+)(?::(.+))?$/ ); my $command = "mysqldump"; - $command .= " -h".$host if defined($host); + $command .= " -h".$host if defined($host); $command .= " -P".$port if defined($port); if ( $dbUser ) { - $command .= " -u".$dbUser; - if ( $dbPass ) - { - $command .= " -p".$dbPass; - } + $command .= ' -u'.$dbUser; + $command .= ' -p"'.$dbPass.'"' if $dbPass; } my $backup = "@ZM_TMPDIR@/".$Config{ZM_DB_NAME}."-".$version.".dump"; $command .= " --add-drop-table --databases ".$Config{ZM_DB_NAME}." > ".$backup; @@ -458,10 +455,7 @@ if ( $version ) if ( $dbUser ) { $command .= " -u".$dbUser; - if ( $dbPass ) - { - $command .= ' -p"'.$dbPass.'"'; - } + $command .= ' -p"'.$dbPass.'"' if $dbPass; } $command .= " ".$Config{ZM_DB_NAME}." < "; if ( $updateDir )