0
0
Fork 0
mirror of https://github.com/ohmyzsh/ohmyzsh.git synced 2024-09-12 04:01:14 +02:00

fix(web-search): use pattern instead of regex

Closes #12202
This commit is contained in:
Carlo Sala 2024-02-07 11:16:36 +01:00
parent 883da63320
commit 43613d7b71
No known key found for this signature in database
GPG key ID: DA6FB450C1A4FE9A

View file

@ -44,7 +44,7 @@ function web_search() {
# if search goes in the query string ==> space as +, otherwise %20
# see https://stackoverflow.com/questions/1634271/url-encoding-the-space-character-or-20
local param="-P"
[[ "$urls[$1]" =~ .*\?.*=$ ]] && param=""
[[ "$urls[$1]" == *\?*= ]] && param=""
# build search url:
# join arguments passed with '+', then append to search engine URL