forked from sloum/bombadillo
HOT FIX: Returned url regex to rightful state and fixed numerical issue with check command
This commit is contained in:
parent
207a45d678
commit
74ada2b8ed
|
@ -586,7 +586,7 @@ func (c *client) doLinkCommand(action, target string) {
|
||||||
num -= 1
|
num -= 1
|
||||||
|
|
||||||
links := c.PageState.History[c.PageState.Position].Links
|
links := c.PageState.History[c.PageState.Position].Links
|
||||||
if num >= len(links) || num < 1 {
|
if num >= len(links) || num < 0 {
|
||||||
c.SetMessage(fmt.Sprintf("Invalid link id: %s", target), true)
|
c.SetMessage(fmt.Sprintf("Invalid link id: %s", target), true)
|
||||||
c.DrawMessage()
|
c.DrawMessage()
|
||||||
return
|
return
|
||||||
|
|
2
url.go
2
url.go
|
@ -68,7 +68,7 @@ func MakeUrl(u string) (Url, error) {
|
||||||
return out, nil
|
return out, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
re := regexp.MustCompile(`^((?P<scheme>[a-zA-Z]+):\/\/)?(?P<host>[\w\-\.\d/]+)(?::(?P<port>\d+)?)?(?:/(?P<type>[01345679gIhisp])?)?(?P<resource>.*)?$`)
|
re := regexp.MustCompile(`^((?P<scheme>[a-zA-Z]+):\/\/)?(?P<host>[\w\-\.\d]+)(?::(?P<port>\d+)?)?(?:/(?P<type>[01345679gIhisp])?)?(?P<resource>.*)?$`)
|
||||||
match := re.FindStringSubmatch(u)
|
match := re.FindStringSubmatch(u)
|
||||||
|
|
||||||
if valid := re.MatchString(u); !valid {
|
if valid := re.MatchString(u); !valid {
|
||||||
|
|
Loading…
Reference in New Issue