Adds in the correct variable when checking for existing querystring value

This commit is contained in:
sloum 2020-05-25 19:12:52 -07:00
parent f793bdd806
commit f47f6597f4
1 changed files with 2 additions and 2 deletions

View File

@ -700,14 +700,14 @@ func (c *client) search(query, uri, question string) {
var rootUrl string var rootUrl string
switch u.Scheme { switch u.Scheme {
case "gopher": case "gopher":
if ind := strings.Index(entry, "\t"); ind >= 0 { if ind := strings.Index(u.Full, "\t"); ind >= 0 {
rootUrl = u.Full[:ind] rootUrl = u.Full[:ind]
} else { } else {
rootUrl = u.Full rootUrl = u.Full
} }
c.Visit(fmt.Sprintf("%s\t%s", rootUrl, entry)) c.Visit(fmt.Sprintf("%s\t%s", rootUrl, entry))
case "gemini": case "gemini":
if ind := strings.Index(entry, "?"); ind >= 0 { if ind := strings.Index(u.Full, "?"); ind >= 0 {
rootUrl = u.Full[:ind] rootUrl = u.Full[:ind]
} else { } else {
rootUrl = u.Full rootUrl = u.Full