Fix file-filter parsing.
This commit is contained in:
parent
2a38a8892c
commit
0e4174d92c
1 changed files with 2 additions and 2 deletions
|
@ -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
|
||||||
|
|
Loading…
Reference in a new issue