Merge pull request #1145 from harshavardhana/fix-segfault

Fix a segfault in mc for progress bar theme init
This commit is contained in:
Harshavardhana
2015-09-30 12:41:33 -07:00
3 changed files with 4 additions and 2 deletions
-1
View File
@@ -314,7 +314,6 @@ func mainCopy(ctx *cli.Context) {
console.SetCustomTheme(map[string]*color.Color{
"Copy": color.New(color.FgGreen, color.Bold),
"Bar": color.New(color.FgGreen, color.Bold),
})
session := newSessionV2()
-1
View File
@@ -314,7 +314,6 @@ func mainMirror(ctx *cli.Context) {
console.SetCustomTheme(map[string]*color.Color{
"Mirror": color.New(color.FgGreen, color.Bold),
"Bar": color.New(color.FgGreen, color.Bold),
})
var e error
+4
View File
@@ -25,6 +25,7 @@ import (
"time"
"github.com/dustin/go-humanize"
"github.com/fatih/color"
"github.com/minio/minio/pkg/probe"
"github.com/minio/pb"
"github.com/olekukonko/ts"
@@ -147,6 +148,9 @@ func getFixedWidth(width, percent int) int {
// newProgressBar - instantiate a pbBar.
func newProgressBar() barSend {
console.SetCustomTheme(map[string]*color.Color{
"Bar": color.New(color.FgGreen, color.Bold),
})
cmdCh := make(chan barMsg)
finishCh := make(chan bool)
go func(cmdCh <-chan barMsg, finishCh chan<- bool) {