Skip to content

Commit

Permalink
Add a directory separator at the end of names in tab completion list …
Browse files Browse the repository at this point in the history
…to indicate directories.
  • Loading branch information
Laurent Monin committed Mar 2, 2009
1 parent 6a8d843 commit 0668b94
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion src/ui_tabcomp.c
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,18 @@ static void tab_completion_read_dir(TabCompData *td, const gchar *path)
gchar *name = dir->d_name;
if (strcmp(name, ".") != 0 && strcmp(name, "..") != 0)
{
list = g_list_prepend(list, path_to_utf8(name));
gchar *abspath = g_build_filename(path, name, NULL);

if (isdir(abspath))
{
gchar *dname = g_strconcat(name, G_DIR_SEPARATOR_S, NULL);
list = g_list_prepend(list, path_to_utf8(dname));
}
else
{
list = g_list_prepend(list, path_to_utf8(name));
}
g_free(abspath);
}
}
closedir(dp);
Expand Down

0 comments on commit 0668b94

Please sign in to comment.