diff options
author | Arne Schwabe <arne@rfc2549.org> | 2012-07-25 15:22:47 +0200 |
---|---|---|
committer | Arne Schwabe <arne@rfc2549.org> | 2012-07-25 15:22:47 +0200 |
commit | 83525a83dc214c33e5a3ecd009eaec639b54accf (patch) | |
tree | 1199218c3f7884163ccffea302a9b0606af000f6 /src/de | |
parent | 47152f7a0c579a482daea16aa771db5a9edb8392 (diff) |
Fix importing custom options with spaces
Diffstat (limited to 'src/de')
-rw-r--r-- | src/de/blinkt/openvpn/ConfigParser.java | 2 | ||||
-rw-r--r-- | src/de/blinkt/openvpn/VpnProfile.java | 6 |
2 files changed, 6 insertions, 2 deletions
diff --git a/src/de/blinkt/openvpn/ConfigParser.java b/src/de/blinkt/openvpn/ConfigParser.java index f9eac745..c8fb3870 100644 --- a/src/de/blinkt/openvpn/ConfigParser.java +++ b/src/de/blinkt/openvpn/ConfigParser.java @@ -472,7 +472,7 @@ public class ConfigParser { for(Vector<Vector<String>> option:options.values()) { for(Vector<String> optionsline: option) { for (String arg : optionsline) - custom+= arg + " "; + custom+= VpnProfile.openVpnEscape(arg) + " "; } custom+="\n"; diff --git a/src/de/blinkt/openvpn/VpnProfile.java b/src/de/blinkt/openvpn/VpnProfile.java index f6c3261a..4e381fcc 100644 --- a/src/de/blinkt/openvpn/VpnProfile.java +++ b/src/de/blinkt/openvpn/VpnProfile.java @@ -117,7 +117,11 @@ public class VpnProfile implements Serializable{ String escapedString = unescaped.replace("\\", "\\\\"); escapedString = escapedString.replace("\"","\\\""); escapedString = escapedString.replace("\n","\\n"); - return '"' + escapedString + '"'; + + if (escapedString.equals(unescaped) && !escapedString.contains(" ")) + return unescaped; + else + return '"' + escapedString + '"'; } |