+2007-01-11 Kjartan Maraas <kmaraas@gnome.org>
+
+ * gtk/gtkfilesystemunix.c: (expand_tilde):
+ Make a single tilde go to $HOME in the location entry.
+ Patch from Yevgen Muntyan. Closes the gtk+ part of
+ bug #334168.
+
2007-01-10 Behdad Esfahbod <behdad@gnome.org>
* gdk/gdkpango.c (gdk_draw_layout_with_colors):
notilde = filename + 1;
slash = strchr (notilde, G_DIR_SEPARATOR);
- if (!slash)
- return NULL;
- if (slash == notilde)
+ if (slash == notilde || !*notilde)
{
home = g_get_home_dir ();
char *username;
struct passwd *passwd;
- username = g_strndup (notilde, slash - notilde);
+ if (slash)
+ username = g_strndup (notilde, slash - notilde);
+ else
+ username = g_strdup (notilde);
+
passwd = getpwnam (username);
g_free (username);
home = passwd->pw_dir;
}
- return g_build_filename (home, G_DIR_SEPARATOR_S, slash + 1, NULL);
+ if (slash)
+ return g_build_filename (home, G_DIR_SEPARATOR_S, slash + 1, NULL);
+ else
+ return g_strdup (home);
}
static gboolean