Skip to content

Commit

Permalink
Print scp status without quotes.
Browse files Browse the repository at this point in the history
Don't escape the final \n in the scp status message. This way the status
message will get printed without double quotes.
  • Loading branch information
russjones committed Dec 7, 2019
1 parent 088be32 commit 9a237b7
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/sshutils/scp/scp.go
Original file line number Diff line number Diff line change
Expand Up @@ -321,8 +321,8 @@ func (cmd *command) sendFile(r *reader, ch io.ReadWriter, fileInfo FileInfo) err

// report progress:
if cmd.ProgressWriter != nil {
statusMessage := fmt.Sprintf("-> %s (%d)\n", fileInfo.GetPath(), fileInfo.GetSize())
defer fmt.Fprintf(cmd.ProgressWriter, utils.EscapeControl(statusMessage))
statusMessage := fmt.Sprintf("-> %s (%d)", fileInfo.GetPath(), fileInfo.GetSize())
defer fmt.Fprintf(cmd.ProgressWriter, utils.EscapeControl(statusMessage)+"\n")
}

_, err = io.WriteString(ch, out)
Expand Down Expand Up @@ -459,8 +459,8 @@ func (cmd *command) receiveFile(st *state, fc newFileCmd, ch io.ReadWriter) erro

// report progress:
if cmd.ProgressWriter != nil {
statusMessage := fmt.Sprintf("<- %s (%d)\n", path, fc.Length)
defer fmt.Fprintf(cmd.ProgressWriter, utils.EscapeControl(statusMessage))
statusMessage := fmt.Sprintf("<- %s (%d)", path, fc.Length)
defer fmt.Fprintf(cmd.ProgressWriter, utils.EscapeControl(statusMessage)+"\n")
}

defer writer.Close()
Expand Down

0 comments on commit 9a237b7

Please sign in to comment.