From 6eeb59bb3f17ab5ae3c311402c2d4bbe4c4dd268 Mon Sep 17 00:00:00 2001 From: Beat Forster Date: Wed, 3 Feb 2010 12:34:35 +0100 Subject: Android: configfiles: avoid double slash in path name --- src/platform_adapters/linux/configfiles.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/platform_adapters/linux/configfiles.cpp b/src/platform_adapters/linux/configfiles.cpp index 70990d0..8e2f36b 100755 --- a/src/platform_adapters/linux/configfiles.cpp +++ b/src/platform_adapters/linux/configfiles.cpp @@ -55,6 +55,7 @@ bool getPlatformString(TPlatformStringID aStringID, string &aString) char buffer[bufsiz]; buffer[0]=0; // terminate for safety string str; + string aSub; struct passwd *userInfoP=NULL; switch (aStringID) { @@ -105,11 +106,15 @@ bool getPlatformString(TPlatformStringID aStringID, string &aString) // My specific subdirectory for storing my app data/prefs userInfoP = getpwuid(getuid()); aString = userInfoP->pw_dir; // user home dir + aSub = APPDATA_SUBDIR; #ifdef ANDROID - aString += "/data/com.sysync/" APPDATA_SUBDIR; // application specific subdir for android + aString += "/data/com.sysync"; // application specific subdir for android + if (!aSub.empty()) aString+= "/"; // slash only if subdir is really there #else - aString += "/.sysync/" APPDATA_SUBDIR; // application specific subdir + aString += "/.sysync/"; // application specific subdir + // don't adapt it here to avoid potential problems on other platforms #endif + aString += aSub; break; #endif /* -- cgit v1.2.3