projects
/
u
/
mdw
/
putty
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
... and there's a Unix port of PSCP. Ooh.
[u/mdw/putty]
/
winsftp.c
diff --git
a/winsftp.c
b/winsftp.c
index
a4dafd4
..
6687210
100644
(file)
--- a/
winsftp.c
+++ b/
winsftp.c
@@
-303,6
+303,7
@@
DirHandle *open_directory(char *name)
h = FindFirstFile(findfile, &fdat);
if (h == INVALID_HANDLE_VALUE)
return NULL;
h = FindFirstFile(findfile, &fdat);
if (h == INVALID_HANDLE_VALUE)
return NULL;
+ sfree(findfile);
ret = snew(DirHandle);
ret->h = h;
ret = snew(DirHandle);
ret->h = h;
@@
-312,11
+313,18
@@
DirHandle *open_directory(char *name)
char *read_filename(DirHandle *dir)
{
char *read_filename(DirHandle *dir)
{
-
if
(!dir->name) {
+
while
(!dir->name) {
WIN32_FIND_DATA fdat;
int ok = FindNextFile(dir->h, &fdat);
WIN32_FIND_DATA fdat;
int ok = FindNextFile(dir->h, &fdat);
- if (ok)
+ if (!ok)
+ return NULL;
+
+ if (fdat.cFileName[0] == '.' &&
+ (fdat.cFileName[1] == '\0' ||
+ (fdat.cFileName[1] == '.' && fdat.cFileName[2] == '\0')))
+ dir->name = NULL;
+ else
dir->name = dupstr(fdat.cFileName);
}
dir->name = dupstr(fdat.cFileName);
}
@@
-449,6
+457,11
@@
int create_directory(char *name)
return CreateDirectory(name, NULL) != 0;
}
return CreateDirectory(name, NULL) != 0;
}
+char *dir_file_cat(char *dir, char *file)
+{
+ return dupcat(dir, "\\", file, NULL);
+}
+
/* ----------------------------------------------------------------------
* Platform-specific network handling.
*/
/* ----------------------------------------------------------------------
* Platform-specific network handling.
*/