progressBar: Finish progress bar if total is greater than 0

In case of 'mc mirror' => mc prints an erroneous progress bar
with 0bytes.

```
mc mirror /usr/local/Cellar/go/1.5.3/libexec play/test123/libexec
0 B / ?  ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░▓  0.00 % 0
```

This patch fixes #1592
This commit is contained in:
Harshavardhana
2016-02-01 13:36:23 -08:00
parent f811b029b1
commit 744b4728d1
2 changed files with 7 additions and 4 deletions
+4 -3
View File
@@ -356,9 +356,10 @@ func doCopySession(session *sessionV6) {
wg.Wait()
if !globalQuiet && !globalJSON {
progressReader.ProgressBar.Finish()
}
if globalQuiet {
if progressReader.ProgressBar.Total > 0 {
progressReader.ProgressBar.Finish()
}
} else {
accntStat := accntReader.Stat()
cpStatMessage := copyStatMessage{
Total: accntStat.Total,
+3 -1
View File
@@ -339,7 +339,9 @@ func doMirrorSession(session *sessionV6) {
wg.Wait()
if !globalQuiet && !globalJSON {
progressReader.ProgressBar.Finish()
if progressReader.ProgressBar.Total > 0 {
progressReader.ProgressBar.Finish()
}
} else {
accntStat := accntReader.Stat()
mrStatMessage := mirrorStatMessage{