HOT FIX: Returned url regex to rightful state and fixed numerical issue with check command

This commit is contained in:
sloumdrone 2019-10-10 22:07:32 -07:00
parent 207a45d678
commit 74ada2b8ed
2 changed files with 2 additions and 2 deletions

View File

@ -586,7 +586,7 @@ func (c *client) doLinkCommand(action, target string) {
num -= 1
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.DrawMessage()
return

2
url.go
View File

@ -68,7 +68,7 @@ func MakeUrl(u string) (Url, error) {
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)
if valid := re.MatchString(u); !valid {