From 703426716aa84321650ae517c4a614e75a9931ee Mon Sep 17 00:00:00 2001 From: Dave Davenport Date: Sun, 16 Oct 2016 14:49:32 +0200 Subject: [PATCH] [DRun] Fix parsing subdirectories because of wrong suffix check --- source/dialogs/drun.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/source/dialogs/drun.c b/source/dialogs/drun.c index db8975ad..e9dd16cd 100644 --- a/source/dialogs/drun.c +++ b/source/dialogs/drun.c @@ -339,10 +339,6 @@ static void walk_dir ( DRunModePrivateData *pd, const char *root, const char *di if ( file->d_name[0] == '.' ) { continue; } - // Skip files not ending on .desktop. - if ( !g_str_has_suffix ( file->d_name, ".desktop" ) ) { - continue; - } switch ( file->d_type ) { case DT_LNK: @@ -368,6 +364,11 @@ static void walk_dir ( DRunModePrivateData *pd, const char *root, const char *di } } } + // Skip files not ending on .desktop. + if ( file->d_type != DT_DIR && !g_str_has_suffix ( file->d_name, ".desktop" ) ) { + g_free(filename); + continue; + } switch ( file->d_type ) {