summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBeat Forster <bfo@synthesis.ch>2010-02-03 12:34:35 +0100
committerLukas Zeller <luz@synthesis.ch>2010-02-03 12:34:35 +0100
commit6eeb59bb3f17ab5ae3c311402c2d4bbe4c4dd268 (patch)
tree2db592842d26ae83488819de239b155b2db8d8c8
parent4a9274e4be5d4f6722c7df8017231bea63719cc3 (diff)
Android: configfiles: avoid double slash in path name
-rwxr-xr-xsrc/platform_adapters/linux/configfiles.cpp9
1 files 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
/*