diff --git a/src/com/jpexs/decompiler/flash/console/CommandLineArgumentParser.java b/src/com/jpexs/decompiler/flash/console/CommandLineArgumentParser.java index 93f6ad740..4e5682b8e 100644 --- a/src/com/jpexs/decompiler/flash/console/CommandLineArgumentParser.java +++ b/src/com/jpexs/decompiler/flash/console/CommandLineArgumentParser.java @@ -877,7 +877,7 @@ public class CommandLineArgumentParser { for (String c : cfgs) { String[] cp = c.split("="); if (cp.length == 1) { - cp = new String[]{cp[0], "1"}; + cp = new String[]{cp[0], ""}; } String nameLowerCase = cp[0].toLowerCase(Locale.ENGLISH); @@ -887,7 +887,7 @@ public class CommandLineArgumentParser { Class type = ConfigurationItem.getConfigurationFieldType(field); if (type == String.class) { - System.out.println("Config " + item.getName() + " set to " + stringValue); + System.out.println("Config " + item.getName() + " set to \"" + Helper.escapeString(stringValue) +"\""); ((ConfigurationItem) item).set(stringValue); } else if (type == Calendar.class) { SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy/MM/dd HH:mm:ss"); @@ -903,7 +903,7 @@ public class CommandLineArgumentParser { } else if (type == Integer.class) { int intValue = Integer.parseInt(stringValue); ((ConfigurationItem) item).set(intValue); - } else if ((type == Integer.class) || (type == Long.class)) { + } else if (type == Long.class) { long longValue = Long.parseLong(stringValue); ((ConfigurationItem) item).set(longValue); } else if (type == Double.class) { @@ -913,6 +913,9 @@ public class CommandLineArgumentParser { float floatValue = Float.parseFloat(stringValue); ((ConfigurationItem) item).set(floatValue); } else if (type == Boolean.class) { + if (stringValue.isEmpty()) { + stringValue = "1"; + } Boolean boolValue = parseBooleanConfigValue(stringValue); if (boolValue != null) { System.out.println("Config " + item.getName() + " set to " + boolValue); diff --git a/src/com/jpexs/decompiler/flash/gui/Main.java b/src/com/jpexs/decompiler/flash/gui/Main.java index 998222217..f80bf2774 100644 --- a/src/com/jpexs/decompiler/flash/gui/Main.java +++ b/src/com/jpexs/decompiler/flash/gui/Main.java @@ -3592,7 +3592,9 @@ public class Main { AppStrings.setResourceClass(MainFrame.class); initLogging(Configuration._debugMode.get()); - initJna(); + if (!(args.length == 2 && "-config".equals(args[0]))) { //To be able to reset JNA directory with -config, if invalid + initJna(); + } initLang(); if (Configuration.cacheOnDisk.get()) {