From 661a1e90263cc348c17620cf0b250bf552dd4056 Mon Sep 17 00:00:00 2001 From: Victor Vieux Date: Tue, 17 Jun 2014 20:45:57 +0000 Subject: [PATCH] prevent panic when empty flag Docker-DCO-1.1-Signed-off-by: Victor Vieux (github: vieux) --- pkg/mflag/flag.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pkg/mflag/flag.go b/pkg/mflag/flag.go index 2cfef331f6..ad23e540fb 100644 --- a/pkg/mflag/flag.go +++ b/pkg/mflag/flag.go @@ -778,6 +778,9 @@ func (f *FlagSet) usage() { } func trimQuotes(str string) string { + if len(str) == 0 { + return str + } type quote struct { start, end byte }