Fix handling of ch and en names - addrom - Simple tool for adding a rom entry to a Pandora's Box 3 list.dat
Log
Files
Refs
LICENSE
---
commit 097db58e536aaec72dab88c3ec7b59afabf8e1e4
parent 3ea0ab1f799f57a253d807aaa232b06e074cdf56
Author: Quentin Rameau 
Date:   Thu, 26 Nov 2015 13:23:48 +0100

Fix handling of ch and en names

Names with special characters (like spaces or dashes) would break
function calling.
Now we pass the name options anyway, but with an empty string if those
are not selected.

Diffstat:
  addrom-processcsv.sh                |       6 +++---

1 file changed, 3 insertions(+), 3 deletions(-)
---
diff --git a/addrom-processcsv.sh b/addrom-processcsv.sh
@@ -68,8 +68,8 @@ do
                 printf "Skipping \"%s\", \"%s\": rom name empty\n" \
                     "$chname" "$enname"
         fi
-        [ "$cflag" -eq 1 ] && [ -n "$chname" ] && chopt="-c$chname" || chopt=
-        [ "$eflag" -eq 1 ] && [ -n "$enname" ] && enopt="-e$enname" || enopt=
+        [ "$cflag" -eq 1 ] || chname=
+        [ "$eflag" -eq 1 ] || enname=
 
-        $ADDROMCMD -i "$ifile" "$chopt" "$enopt" -r "$romname"
+        $ADDROMCMD -i "$ifile" -c "$chname" -e "$enname" -r "$romname"
 done < "$csvfile"