From ce53e21ea6790cf7c2e96f8c5f0725bdf41a80f0 Mon Sep 17 00:00:00 2001 From: David Calavera Date: Sun, 1 Sep 2013 16:12:07 -0700 Subject: [PATCH] Read the stdin line properly. Load the auth config before it's used. --- commands.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/commands.go b/commands.go index 95f67f4f33..7760108588 100644 --- a/commands.go +++ b/commands.go @@ -277,14 +277,15 @@ func (cli *DockerCli) CmdLogin(args ...string) error { readInput := func(in io.Reader, out io.Writer) string { reader := bufio.NewReader(in) - line, err := reader.ReadString('\n') + line, _, err := reader.ReadLine() if err != nil { fmt.Fprintln(out, err.Error()) os.Exit(1) } - return line + return string(line) } + cli.LoadConfigFile() authconfig, ok := cli.configFile.Configs[auth.IndexServerAddress()] if !ok { authconfig = auth.AuthConfig{}