diff --git a/client.go b/client.go index 3a1a975..5625bf5 100644 --- a/client.go +++ b/client.go @@ -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 diff --git a/url.go b/url.go index 8b23d1b..b77f0c6 100644 --- a/url.go +++ b/url.go @@ -68,7 +68,7 @@ func MakeUrl(u string) (Url, error) { return out, nil } - re := regexp.MustCompile(`^((?P[a-zA-Z]+):\/\/)?(?P[\w\-\.\d/]+)(?::(?P\d+)?)?(?:/(?P[01345679gIhisp])?)?(?P.*)?$`) + re := regexp.MustCompile(`^((?P[a-zA-Z]+):\/\/)?(?P[\w\-\.\d]+)(?::(?P\d+)?)?(?:/(?P[01345679gIhisp])?)?(?P.*)?$`) match := re.FindStringSubmatch(u) if valid := re.MatchString(u); !valid {