From 165aa948f88efe9bff10d18de34ab1c2a2be5c44 Mon Sep 17 00:00:00 2001 From: Pekka Riikonen Date: Fri, 8 Feb 2002 13:17:38 +0000 Subject: [PATCH] updates --- TODO | 3 +++ lib/silcsftp/sftp_fs_memory.c | 26 +++++++++++++------------- 2 files changed, 16 insertions(+), 13 deletions(-) diff --git a/TODO b/TODO index 7eca1b9c..6f543827 100644 --- a/TODO +++ b/TODO @@ -110,6 +110,9 @@ TODO/bugs In SILC Libraries o Rewrite the lib/silcsim/silcsim.h. The SilcSimContext should be private and silc_sim_alloc should take necessary arguments. + o lib/silcsftp/sftp_fs_memory.c use directly open(), close() etc. + routines. Change to use silc_file_* routines. + TODO in SILC Protocol ===================== diff --git a/lib/silcsftp/sftp_fs_memory.c b/lib/silcsftp/sftp_fs_memory.c index 04979b72..17f3293e 100644 --- a/lib/silcsftp/sftp_fs_memory.c +++ b/lib/silcsftp/sftp_fs_memory.c @@ -661,7 +661,7 @@ void mem_opendir(void *context, SilcSFTP sftp, MemFSFileHandle handle; if (!path || !strlen(path)) - path = (const char *)strdup("/"); + path = (const char *)DIR_SEPARATOR; /* Find such directory */ entry = mem_find_entry_path(fs->root, path); @@ -730,12 +730,12 @@ void mem_readdir(void *context, SilcSFTP sftp, *strrchr(date, ':') = '\0'; if (!entry->directory) -#ifndef SILC_WIN32 +#ifndef SILC_WIN32 if (!lstat(entry->data + 7, &stats)) -#else - if (!stat(entry->data + 7, &stats)) -#endif - filesize = stats.st_size; +#else + if (!stat(entry->data + 7, &stats)) +#endif + filesize = stats.st_size; /* Long name format is: drwx------ 1 324210 Apr 8 08:40 mail/ @@ -800,7 +800,7 @@ void mem_stat(void *context, SilcSFTP sftp, struct stat stats; if (!path || !strlen(path)) - path = (const char *)strdup("/"); + path = (const char *)DIR_SEPARATOR; /* Find such directory */ entry = mem_find_entry_path(fs->root, path); @@ -850,7 +850,7 @@ void mem_lstat(void *context, SilcSFTP sftp, struct stat stats; if (!path || !strlen(path)) - path = (const char *)strdup("/"); + path = (const char *)DIR_SEPARATOR; /* Find such directory */ entry = mem_find_entry_path(fs->root, path); @@ -865,11 +865,11 @@ void mem_lstat(void *context, SilcSFTP sftp, } /* Get real stat */ -#ifndef SILC_WIN32 +#ifndef SILC_WIN32 ret = lstat(entry->data + 7, &stats); -#else - ret = stat(entry->data + 7, &stats); -#endif +#else + ret = stat(entry->data + 7, &stats); +#endif if (ret == -1) { (*callback)(sftp, silc_sftp_map_errno(errno), NULL, callback_context); return; @@ -984,7 +984,7 @@ void mem_realpath(void *context, SilcSFTP sftp, SilcSFTPName name; if (!path || !strlen(path)) - path = (const char *)strdup("/"); + path = (const char *)DIR_SEPARATOR; realpath = mem_expand_path(fs->root, path); if (!realpath) { -- 2.24.0