From 2b00e00f266235857dc66dc0781b70dce208e410 Mon Sep 17 00:00:00 2001 From: cuu Date: Tue, 15 Jan 2019 01:06:12 +0800 Subject: [PATCH] rom_list_page improves --- sysgo/UI/Emulator/rom_list_page.go | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/sysgo/UI/Emulator/rom_list_page.go b/sysgo/UI/Emulator/rom_list_page.go index 89164cd..830327c 100644 --- a/sysgo/UI/Emulator/rom_list_page.go +++ b/sysgo/UI/Emulator/rom_list_page.go @@ -4,7 +4,7 @@ import ( "fmt" "os" "strings" - "regexp" + //"regexp" "path/filepath" "os/exec" "errors" @@ -106,12 +106,11 @@ func (self *RomListPage) GeneratePathList(path string) ([]map[string]string,erro if len(bname) > 1 { is_excluded := false - for _,exclude_pattern := range self.EmulatorConfig.EXCLUDE { - if matched, err := regexp.MatchString(exclude_pattern,bname); err == nil { - if matched == true { - is_excluded = true - break - } + for _,exclude_ext := range self.EmulatorConfig.EXCLUDE { + exclude_ext2 := strings.Trim(exclude_ext,"\r\n ") + if len(exclude_ext2) > 1 && strings.HasSuffix(bname,exclude_ext2) { + is_excluded= true + break } }