From 915c6a7cdab0dff0150598da170967bcdd404cfc Mon Sep 17 00:00:00 2001 From: tastytea Date: Tue, 24 May 2022 00:22:55 +0200 Subject: [PATCH] readwwwlog: Remove trailing slash --- .config/zsh/functions/readwwwlog | 1 + 1 file changed, 1 insertion(+) diff --git a/.config/zsh/functions/readwwwlog b/.config/zsh/functions/readwwwlog index 002d0df..4ef591b 100755 --- a/.config/zsh/functions/readwwwlog +++ b/.config/zsh/functions/readwwwlog @@ -21,6 +21,7 @@ local default_cmd="firefox" local termopts="" for url in ${urls}; do + [[ ${url[-1]} == "/" ]] && url=${url[1,-2]} # Remove trailing slash (safe?) local id=${url##*/} # Most paste services have the ID as the last element if [[ ${url} =~ 'dpaste\.com' && ! ${url[-4,-1]} == ".txt" ]]; then