Fix file-filter parsing.

This commit is contained in:
Nuno Cruces 2021-02-18 13:14:32 +00:00
parent 2a38a8892c
commit 0e4174d92c

View file

@ -384,11 +384,11 @@ func (f *FileFilters) Set(s string) error {
var filter zenity.FileFilter var filter zenity.FileFilter
if split := strings.SplitN(s, "|", 2); len(split) > 1 { if split := strings.SplitN(s, "|", 2); len(split) > 1 {
filter.Name = split[0] filter.Name = strings.TrimSpace(split[0])
s = split[1] s = split[1]
} }
filter.Patterns = strings.Split(s, " ") filter.Patterns = strings.Split(strings.TrimSpace(s), " ")
f.FileFilters = append(f.FileFilters, filter) f.FileFilters = append(f.FileFilters, filter)
return nil return nil