From 1e240293009817680e715c1fada89d61836850eb Mon Sep 17 00:00:00 2001 From: Arne Schwabe Date: Tue, 10 Jul 2012 09:52:26 +0200 Subject: Fix duplicate inline tag (closes issue #51) --- src/de/blinkt/openvpn/ConfigConverter.java | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/de/blinkt/openvpn/ConfigConverter.java b/src/de/blinkt/openvpn/ConfigConverter.java index 9b97cf14..101c90b0 100644 --- a/src/de/blinkt/openvpn/ConfigConverter.java +++ b/src/de/blinkt/openvpn/ConfigConverter.java @@ -136,7 +136,7 @@ public class ConfigConverter extends ListActivity { len = fis.read(buf); } fis.close(); - return filedata; + return VpnProfile.INLINE_TAG + filedata; } catch (FileNotFoundException e) { log(e.getLocalizedMessage()); } catch (IOException e) { @@ -154,15 +154,16 @@ public class ConfigConverter extends ListActivity { // This where I would like to have a c++ style // void embedFile(std::string & option) - mResult.mCaFilename = VpnProfile.INLINE_TAG + embedFile(mResult.mCaFilename); - mResult.mClientCertFilename = VpnProfile.INLINE_TAG + embedFile(mResult.mClientCertFilename); - mResult.mClientKeyFilename = VpnProfile.INLINE_TAG + embedFile(mResult.mClientKeyFilename); - mResult.mTLSAuthFilename = VpnProfile.INLINE_TAG + embedFile(mResult.mTLSAuthFilename); + mResult.mCaFilename = embedFile(mResult.mCaFilename); + mResult.mClientCertFilename = embedFile(mResult.mClientCertFilename); + mResult.mClientKeyFilename = embedFile(mResult.mClientKeyFilename); + mResult.mTLSAuthFilename = embedFile(mResult.mTLSAuthFilename); if(mResult.mUsername != null && !mResult.mUsername.equals("")){ String data =embedFile(mResult.mUsername); mResult.mName=null; if(data!=null) { + data = data.replace(VpnProfile.INLINE_TAG, ""); String[] parts = data.split("\n"); if(parts.length >= 2) { mResult.mName=parts[0]; -- cgit v1.2.3