summaryrefslogtreecommitdiff
path: root/storage/connect/osutil.c
diff options
context:
space:
mode:
Diffstat (limited to 'storage/connect/osutil.c')
-rw-r--r--storage/connect/osutil.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/storage/connect/osutil.c b/storage/connect/osutil.c
index af5faa5b13b..32debe02107 100644
--- a/storage/connect/osutil.c
+++ b/storage/connect/osutil.c
@@ -16,6 +16,7 @@ my_bool CloseFileHandle(HANDLE h)
#include <sys/stat.h>
#include <ctype.h>
#include <fcntl.h>
+#include <pwd.h>
extern FILE *debug;
@@ -176,8 +177,10 @@ char *_fullpath(char *absPath, const char *relPath, size_t maxLength)
strncpy(absPath, relPath, maxLength);
} else if(*relPath == '~') {
// get the path to the home directory
- // Fixme
- strncpy(absPath, relPath, maxLength);
+ struct passwd *pw = getpwuid_r(getuid());
+ const char *homedir = pw->pw_dir;
+
+ strcat(strcat(strncpy(absPath, homedir, maxLength), "/"), relPath);
} else {
char buff[2*_MAX_PATH];