Skip to content

Commit

Permalink
Use g_build_filename() and get rid of "root dir fix".
Browse files Browse the repository at this point in the history
  • Loading branch information
Laurent Monin committed May 21, 2008
1 parent 0b30da0 commit fe45471
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions src/filedata.c
Original file line number Diff line number Diff line change
Expand Up @@ -629,19 +629,12 @@ static gint filelist_read_real(const gchar *path, GList **files, GList **dirs, g
return FALSE;
}

/* root dir fix */
if (pathl[0] == '/' && pathl[1] == '\0')
{
g_free(pathl);
pathl = g_strdup("");
}

while ((dir = readdir(dp)) != NULL)
{
gchar *name = dir->d_name;
if (options->file_filter.show_hidden_files || !ishidden(name))
{
gchar *filepath = g_strconcat(pathl, "/", name, NULL);
gchar *filepath = g_build_filename(pathl, name, NULL);
if ((follow_symlinks ?
stat(filepath, &ent_sbuf) :
lstat(filepath, &ent_sbuf)) >= 0)
Expand Down

0 comments on commit fe45471

Please sign in to comment.