updates
[silc.git] / lib / silcsftp / sftp_fs_memory.c
index 04979b720f90a84995c7ec00b5462869eed1f6b1..17f3293e668955b9e909ef4a1f8ea3c475004e59 100644 (file)
@@ -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\r
+#ifndef SILC_WIN32
                if (!lstat(entry->data + 7, &stats))
-#else\r
-               if (!stat(entry->data + 7, &stats))\r
-#endif\r
-                       filesize = stats.st_size;\r
+#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\r
+#ifndef SILC_WIN32
   ret = lstat(entry->data + 7, &stats);
-#else\r
-  ret = stat(entry->data + 7, &stats);\r
-#endif\r
+#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) {