Browse Source

Fix cmdline `printf` bug

`printf` interprets the first chars of a format
string starting with '-' as an option and it's
argument. So placing $@ as format string results
in a true mess. Use '--' before format string to
end options parsing.
Matteo Savatteri 3 years ago
parent
commit
ebdcf9227e
1 changed files with 1 additions and 1 deletions
  1. 1 1
      vaporget

+ 1 - 1
vaporget

@@ -61,7 +61,7 @@ WEBSITE="https://vaporwave.ivan.moe/list/"
 # Look for -V; if found, return 2
 check_options()
 {
-	local OPTIONS_STRING=$(printf "$CMDLINE" | sed -e 's/ [^-]*//g' -e 's/-//g')
+	local OPTIONS_STRING=$(printf -- "$CMDLINE" | sed -e 's/ [^-]*//g' -e 's/-//g')
 
 	if [ "${OPTIONS_STRING#*h}" != "$OPTIONS_STRING" ]
 	then