gobwas/glob

Hangs on empty string

nsf opened this issue · 2 comments

nsf commented
package main

import (
        "github.com/gobwas/glob"
)

func main() {
        glob.Compile("")
}

Result:

fatal error: all goroutines are asleep - deadlock!

goroutine 1 [chan send]:
github.com/gobwas/glob.lexText(0xc8200560c0, 0xc82003bca8)
        /home/nsf/waytogo/src/github.com/gobwas/glob/lexer.go:311 +0x224
github.com/gobwas/glob.(*lexer).nextItem(0xc8200560c0, 0x0, 0x0, 0x0)
        /home/nsf/waytogo/src/github.com/gobwas/glob/lexer.go:165 +0xc3
github.com/gobwas/glob.parserMain(0xc8200101c0, 0xc8200560c0, 0xc82000e360, 0x0, 0x0)
        /home/nsf/waytogo/src/github.com/gobwas/glob/parser.go:102 +0x4b
github.com/gobwas/glob.parse(0xc8200560c0, 0xc8200560c0, 0x0, 0x0)
        /home/nsf/waytogo/src/github.com/gobwas/glob/parser.go:85 +0xe9
github.com/gobwas/glob.Compile(0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0)
        /home/nsf/waytogo/src/github.com/gobwas/glob/glob.go:35 +0x165
main.main()
        /home/nsf/tmp/gobug/a.go:8 +0x34

Hi! Got it, will fix soon =)

Done.