From: Robert 'phaylon' Sedlacek Date: Thu, 7 Jun 2012 14:26:11 +0000 (+0000) Subject: made newline before GO reply optional X-Git-Tag: v0.001001~26 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=aa052874c2efdb5837fd42ae2f924d6f05b49c71;p=scpubgit%2FObject-Remote.git made newline before GO reply optional --- diff --git a/lib/Object/Remote/Connector/LocalSudo.pm b/lib/Object/Remote/Connector/LocalSudo.pm index 1bd6d6e..aa19ced 100644 --- a/lib/Object/Remote/Connector/LocalSudo.pm +++ b/lib/Object/Remote/Connector/LocalSudo.pm @@ -35,11 +35,14 @@ sub _start_perl { unless $cb; print $foreign_stdin $cb->($line, @_), "\n"; chomp($line = <$sudo_stderr>); - die "sent password and expected newline from sudo, got ${line}" - if $line; - chomp($line = <$sudo_stderr>); - die "sent password but next line was ${line}" - unless $line eq "GO"; + if ($line and $line ne 'GO') { + die "sent password and expected newline from sudo, got ${line}"; + } + elsif (not $line) { + chomp($line = <$sudo_stderr>); + die "sent password but next line was ${line}" + unless $line eq "GO"; + } } else { die "Got inexplicable line ${line} trying to sudo"; };