From 72e6b4705df58f24781cdce3f721e58ccb27a369 Mon Sep 17 00:00:00 2001
From: Vitaly Lipatov <lav@etersoft.ru>
Date: Sun, 2 Jul 2023 18:57:02 +0300
Subject: [PATCH] eget: fix concatenate_url_and_filename()

---
 bin/tools_eget | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/bin/tools_eget b/bin/tools_eget
index 6cc86d8c..c253ddfc 100755
--- a/bin/tools_eget
+++ b/bin/tools_eget
@@ -1272,10 +1272,9 @@ get_host_only()
 
 concatenate_url_and_filename()
 {
-    local url="$1"
-    local fn="$2"
-    # workaround for a slash in the end of URL
-    echo "$(echo "$url" | sed -e 's|/*$||' )/$fn"
+    local url="$(echo "$1" | sed -e 's|/*$||' )"
+    local fn="$(echo "$2" | sed -e 's|^/*||' )"
+    echo "$url/$fn"
 }
 
 # MADEURL filled with latest made URL as flag it is end form of URL
-- 
2.24.1