From a009702cd6ae5954d666869a1861ecb7e59bc2b5 Mon Sep 17 00:00:00 2001 From: Andreas Schneider Date: Wed, 12 May 2010 13:08:45 +0200 Subject: Fixed Windows build warnings. --- libssh/misc.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'libssh/misc.c') diff --git a/libssh/misc.c b/libssh/misc.c index c3ebfd27..4b562c71 100644 --- a/libssh/misc.c +++ b/libssh/misc.c @@ -35,6 +35,7 @@ #ifdef _WIN32 #define _WIN32_IE 0x0501 //SHGetSpecialFolderPath #include // Must be the first to include +#include #include #include #else @@ -503,7 +504,8 @@ int ssh_mkdir(const char *pathname, mode_t mode) { * @return The expanded directory, NULL on error. */ char *ssh_path_expand_tilde(const char *d) { - char *h, *r, *p; + char *h, *r; + const char *p; size_t ld; size_t lh = 0; @@ -515,6 +517,9 @@ char *ssh_path_expand_tilde(const char *d) { /* handle ~user/path */ p = strchr(d, '/'); if (p != NULL && p > d) { +#ifdef _WIN32 + return strdup(d); +#else struct passwd *pw; size_t s = p - d; char u[128]; @@ -530,6 +535,7 @@ char *ssh_path_expand_tilde(const char *d) { } ld = strlen(p); h = strdup(pw->pw_dir); +#endif } else { ld = strlen(d); p = (char *) d; -- cgit