Yasumichi Akahoshi
yasum****@users*****
2005年 10月 2日 (日) 23:58:12 JST
Index: cxplorer/src/cxp-right-pane.c diff -u cxplorer/src/cxp-right-pane.c:1.80 cxplorer/src/cxp-right-pane.c:1.81 --- cxplorer/src/cxp-right-pane.c:1.80 Sun Oct 2 02:50:01 2005 +++ cxplorer/src/cxp-right-pane.c Sun Oct 2 23:58:11 2005 @@ -558,7 +558,8 @@ gchar *mimetype; gchar *fullpath; gchar buf[1024]; - gchar *linkend; + GString *linkend; + gchar *tmp; gchar *linkmime; GdkPixbuf *icon; GdkPixbuf *mask; @@ -573,19 +574,26 @@ switch (mode & S_IFMT) { case S_IFLNK: - if((length = readlink(fullpath, buf, 1024)) > 0) + linkend = g_string_new(fullpath); + while((length = readlink(linkend->str, buf, 1024)) > 0) { buf[length] = '\0'; - linkmime = cxp_get_mime_type_for_file (buf); - icon = gdk_pixbuf_copy (cxp_lookup_icon_from_mime (linkmime)); - mask = cxp_lookup_icon_from_mime (mimetype); - gdk_pixbuf_composite (mask, icon, 0, 0, 16, 16, 0.0, 0.0, 1.0, 1.0, GDK_INTERP_NEAREST, 255); - g_free (linkmime); - } - else - { - icon = cxp_lookup_icon_from_mime (mimetype); + if(g_path_is_absolute(buf)) + { + g_string_assign (linkend, buf); + } + else + { + tmp = g_build_filename (linkend->str, buf, NULL); + g_string_assign (linkend, tmp); + g_free (tmp); + } } + linkmime = cxp_get_mime_type_for_file (linkend->str); + icon = gdk_pixbuf_copy (cxp_lookup_icon_from_mime (linkmime)); + mask = cxp_lookup_icon_from_mime (mimetype); + gdk_pixbuf_composite (mask, icon, 0, 0, 16, 16, 0.0, 0.0, 1.0, 1.0, GDK_INTERP_NEAREST, 255); + g_string_free (linkend, TRUE); break; default: icon = cxp_lookup_icon_from_mime (mimetype);