Fixup url simplifier loop

Now, the loop which successively simplifies the url, always terminates.
This commit is contained in:
Thorsten Wißmann 2015-12-09 23:25:55 +01:00
parent ffdc0f664f
commit 497a6e0720

View File

@ -92,7 +92,14 @@ simplify_url() {
# are found:
no_entries_found() {
while [ 0 -eq "${#files[@]}" ] && [ -n "$simple_url" ]; do
simple_url=$(sed 's,^[^.]*\.,,' <<< "$simple_url")
shorter_simple_url=$(sed 's,^[^.]*\.,,' <<< "$simple_url")
if [ "$shorter_simple_url" = "$simple_url" ] ; then
# if no dot, then even remove the top level domain
simple_url=""
query_entries "$simple_url"
break
fi
simple_url="$shorter_simple_url"
query_entries "$simple_url"
#die "No entry found for »$simple_url«"
# enforce menu if we do "fuzzy" matching