changeset 1492:5a44698a302b

fixed the upload
author Cristi Magherusan <majeru@atheme-project.org>
date Tue, 14 Aug 2007 22:55:17 +0300
parents c2fa3728df43
children f9310819285c
files src/mtp_up/mtp.c
diffstat 1 files changed, 13 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/src/mtp_up/mtp.c	Tue Aug 14 00:14:43 2007 +0300
+++ b/src/mtp_up/mtp.c	Tue Aug 14 22:55:17 2007 +0300
@@ -73,16 +73,26 @@
         if (entry->selected)  
         {
             tuple = entry->tuple;
-            from_path = g_strdup_printf("%s/%s", tuple_get_string(tuple, "file-path"), tuple_get_string(tuple, "file-name"));
+            from_path = g_strdup_printf("%s/%s", tuple_get_string(tuple, "file-path"), tuple_get_string(tuple, "file-name"));       
+            g_print("From_path: '%s'",from_path);
             f = vfs_fopen(from_path,"r");
             if(!vfs_is_streaming(f))
                 {
                     filename=g_filename_from_uri(from_path,NULL,NULL);
-                    up_list=g_list_prepend(up_list,filename);
+                    g_print("Filename: '%s'\n",filename);
+                    if(filename!= NULL)
+                        {
+                            up_list=g_list_prepend(up_list,filename);
+                            g_free(from_path);    
+                        }
+                    else 
+                        {
+                            up_list=g_list_prepend(up_list,from_path);
+                            g_free(filename);
+                        }
                 }
             vfs_fclose(f);
             entry->selected = FALSE;
-            g_free(from_path);
         }
         node = g_list_next(node);
     }