Little fix.
authorHong Jen Yee (PCMan) <pcman.tw@gmail.com>
Sun, 28 Mar 2010 18:19:50 +0000 (02:19 +0800)
committerHong Jen Yee (PCMan) <pcman.tw@gmail.com>
Sun, 28 Mar 2010 18:20:12 +0000 (02:20 +0800)
lxsession/xdg-autostart.c

index 01513a6..151c625 100644 (file)
@@ -276,10 +276,13 @@ static void get_autostart_files_in_dir( GHashTable* hash, const char* de_name, c
         char *path;
         const char *name;
 
-        while( (name = g_dir_read_name( dir )) && g_str_has_suffix( name, ".desktop" ) )
+        while( name = g_dir_read_name( dir ) )
         {
-            path = g_build_filename( dir_path, name, NULL );
-            g_hash_table_replace( hash, g_strdup(name), path );
+            if(g_str_has_suffix(name, ".desktop"))
+            {
+                path = g_build_filename( dir_path, name, NULL );
+                g_hash_table_replace( hash, g_strdup(name), path );
+            }
         }
         g_dir_close( dir );
     }