From 1911f7c8206146aa02dc6f7870d0b8fb83db0f56 Mon Sep 17 00:00:00 2001 From: Vamist Date: Tue, 6 Dec 2022 11:10:37 +0000 Subject: [fix] Sorting breaks subdir downloading - Small check in render.rs make_link_with_trailing_slash to return nothing if link is empty, instead of adding a / --- src/renderer.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/renderer.rs b/src/renderer.rs index 5ba69a2..155dfe3 100644 --- a/src/renderer.rs +++ b/src/renderer.rs @@ -411,7 +411,7 @@ fn archive_button( /// Ensure that there's always a trailing slash behind the `link`. fn make_link_with_trailing_slash(link: &str) -> String { - if link.ends_with('/') { + if link.is_empty() || link.ends_with('/') { link.to_string() } else { format!("{}/", link) -- cgit v1.2.3