mirror of
https://github.com/ergochat/ergo.git
synced 2024-12-01 16:39:26 +01:00
fix #1327
This commit is contained in:
parent
a412870514
commit
4b2a094921
@ -222,6 +222,7 @@ func realSkeleton(name string) (string, error) {
|
|||||||
// Shivaram@good-fortune -> *!shivaram@good-fortune
|
// Shivaram@good-fortune -> *!shivaram@good-fortune
|
||||||
// EDMUND -> edmund!*@*
|
// EDMUND -> edmund!*@*
|
||||||
func CanonicalizeMaskWildcard(userhost string) (expanded string, err error) {
|
func CanonicalizeMaskWildcard(userhost string) (expanded string, err error) {
|
||||||
|
userhost = strings.TrimSpace(userhost)
|
||||||
var nick, user, host string
|
var nick, user, host string
|
||||||
bangIndex := strings.IndexByte(userhost, '!')
|
bangIndex := strings.IndexByte(userhost, '!')
|
||||||
strudelIndex := strings.IndexByte(userhost, '@')
|
strudelIndex := strings.IndexByte(userhost, '@')
|
||||||
|
@ -215,6 +215,7 @@ func TestCanonicalizeMaskWildcard(t *testing.T) {
|
|||||||
tester("shivaram*", "shivaram*!*@*", nil)
|
tester("shivaram*", "shivaram*!*@*", nil)
|
||||||
tester("Shivaram*", "shivaram*!*@*", nil)
|
tester("Shivaram*", "shivaram*!*@*", nil)
|
||||||
tester("*SHIVARAM*", "*shivaram*!*@*", nil)
|
tester("*SHIVARAM*", "*shivaram*!*@*", nil)
|
||||||
|
tester("*SHIVARAM* ", "*shivaram*!*@*", nil)
|
||||||
}
|
}
|
||||||
|
|
||||||
func validFoldTester(first, second string, equal bool, folder func(string) (string, error), t *testing.T) {
|
func validFoldTester(first, second string, equal bool, folder func(string) (string, error), t *testing.T) {
|
||||||
|
Loading…
Reference in New Issue
Block a user