diff --git a/ChangeLog b/ChangeLog index f9bfbe0b995620e1a0e28f4db467e8df2fd9b01c..1b001b1afd495897e9d9b728fe71d11c8ae23b6e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2006-07-08 Benedikt Meurer <benny@xfce.org> + + * thunar-vfs/thunar-vfs-path.c(thunar_vfs_path_escape_uri): Fix + alignment issues for Linux/sparc. Bug #1983. + 2006-07-06 Benedikt Meurer <benny@xfce.org> * thunar/thunar-list-model.c(thunar_list_model_get_sort_column_id): diff --git a/thunar-vfs/thunar-vfs-path.c b/thunar-vfs/thunar-vfs-path.c index b00cb53c2b237bdba6d08eb3ac737f5bf004b27b..a418d093a1f52fdfac33c1658d466a5d42a2a1d8 100644 --- a/thunar-vfs/thunar-vfs-path.c +++ b/thunar-vfs/thunar-vfs-path.c @@ -122,13 +122,22 @@ thunar_vfs_path_escape_uri (const ThunarVfsPath *path, ThunarVfsPathItem *item; ThunarVfsPathItem *root = NULL; - const gchar *s = "file:///"; + const gchar *s; guchar c; gchar *t = buffer + 8; - /* prepend the 'file:///' string */ + /* prepend the 'file:///' string (using a simple optimization on i386/ppc) */ +#if defined(__GNUC__) && (defined(__i386__) || defined(__ppc__)) + s = "file:///"; ((guint32 *) buffer)[0] = ((const guint32 *) s)[0]; ((guint32 *) buffer)[1] = ((const guint32 *) s)[1]; +#else + /* hopefully the compiler will be able to optimize this */ + buffer[0] = 'f'; buffer[1] = 'i'; + buffer[2] = 'l'; buffer[3] = 'e'; + buffer[4] = ':'; buffer[5] = '/'; + buffer[6] = '/'; buffer[7] = '/'; +#endif /* generate the path item list (reverse parent relation) */ for (; path->parent != NULL; path = path->parent)