summaryrefslogtreecommitdiffstats
path: root/libssh/misc.c
diff options
context:
space:
mode:
Diffstat (limited to 'libssh/misc.c')
-rw-r--r--libssh/misc.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/libssh/misc.c b/libssh/misc.c
index 2b2158f..8cbc017 100644
--- a/libssh/misc.c
+++ b/libssh/misc.c
@@ -35,6 +35,7 @@
#ifdef _WIN32
#define _WIN32_IE 0x0501 //SHGetSpecialFolderPath
#include <winsock2.h> // Must be the first to include
+#include <ws2tcpip.h>
#include <shlobj.h>
#include <direct.h>
#else
@@ -531,7 +532,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;
@@ -543,6 +545,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];
@@ -558,6 +563,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;