g_free(entry_dir);
return home_exp;
}
+
if (isdir(entry_dir) && strcmp(entry_file, ".") != 0 && strcmp(entry_file, "..") != 0)
{
ptr = entry_dir + strlen(entry_dir) - 1;
- if (ptr[0] == '/')
+ if (ptr[0] == G_DIR_SEPARATOR)
{
if (home_exp)
{
const gchar *file;
file = td->file_list->data;
- buf = g_strconcat(entry_dir, file, NULL);
+ buf = g_build_filename(entry_dir, file, NULL);
if (isdir(buf))
{
+ gchar *tmp = g_strconcat(buf, G_DIR_SEPARATOR_S, NULL);
g_free(buf);
- buf = g_strconcat(entry_dir, file, "/", NULL);
+ buf = tmp;
}
gtk_entry_set_text(GTK_ENTRY(td->entry), buf);
gtk_editable_set_position(GTK_EDITABLE(td->entry), strlen(buf));
}
else
{
- gchar *buf = g_strconcat(entry_dir, "/", NULL);
+ gchar *buf = g_strconcat(entry_dir, G_DIR_SEPARATOR_S, NULL);
gtk_entry_set_text(GTK_ENTRY(td->entry), buf);
gtk_editable_set_position(GTK_EDITABLE(td->entry), strlen(buf));
g_free(buf);
if (strlen(entry_dir) == 0)
{
g_free(entry_dir);
- entry_dir = g_strdup("/");
+ entry_dir = g_strdup(G_DIR_SEPARATOR_S); /* FIXME: win32 */
}
if (isdir(entry_dir))
tab_completion_read_dir(td, entry_dir);
}
- if (strcmp(entry_dir, "/") == 0) entry_dir[0] = '\0';
+ if (strcmp(entry_dir, G_DIR_SEPARATOR_S) == 0) entry_dir[0] = '\0'; /* FIXME: win32 */
list = td->file_list;
while (list)
gchar *file = poss->data;
gchar *buf;
- buf = g_strconcat(entry_dir, "/", file, NULL);
+ buf = g_build_filename(entry_dir, file, NULL);
if (isdir(buf))
{
+ gchar *tmp = g_strconcat(buf, G_DIR_SEPARATOR_S, NULL);
g_free(buf);
- buf = g_strconcat(entry_dir, "/", file, "/", NULL);
+ buf = tmp;
}
gtk_entry_set_text(GTK_ENTRY(td->entry), buf);
gtk_editable_set_position(GTK_EDITABLE(td->entry), strlen(buf));
gchar *buf;
file = g_strdup(test_file);
file[c] = '\0';
- buf = g_strconcat(entry_dir, "/", file, NULL);
+ buf = g_build_filename(entry_dir, file, NULL);
gtk_entry_set_text(GTK_ENTRY(td->entry), buf);
gtk_editable_set_position(GTK_EDITABLE(td->entry), strlen(buf));