aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorXavier Del Campo Romero <xavi.dcr@tutanota.com>2023-11-23 14:38:58 +0100
committerXavier Del Campo Romero <xavi.dcr@tutanota.com>2023-11-23 14:38:58 +0100
commit1f538cbd474649d5cdd4001001b9a39c9955f721 (patch)
treead109061b3867041b4752843dad33390645c8e87
parentf973213ec7be3a1ea14f122ecb65a280af3ae7ee (diff)
Add -- to basename(1)
Otherwise, files starting with - might be interpreted by basename(1), leading to unexpected behaviour.
-rwxr-xr-xslcl-upload2
1 files changed, 1 insertions, 1 deletions
diff --git a/slcl-upload b/slcl-upload
index 8b0d8d9..42a546e 100755
--- a/slcl-upload
+++ b/slcl-upload
@@ -121,7 +121,7 @@ upload_dir()
--fail-with-body \
-b "$cookie" \
-F dir="$dir$src/" \
- -F "file=@$src/$f;filename=$(basename "$f")" \
+ -F "file=@$src/$f;filename=$(basename -- "$f")" \
"$(escape_url "$url/upload")"
do
printf "[retrying]"