From f9cd5cae22fe397c0793688864c42e82c98e15c6 Mon Sep 17 00:00:00 2001 From: Dongju Chae Date: Thu, 23 Jan 2020 17:16:07 +0900 Subject: [PATCH] [Fix] Skip duplicated paths from multiple conf sources This commit skips duplicated paths from multiple conf sources. Signed-off-by: Dongju Chae --- gst/nnstreamer/nnstreamer_conf.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/gst/nnstreamer/nnstreamer_conf.c b/gst/nnstreamer/nnstreamer_conf.c index f73d6dc..ad4f25c 100644 --- a/gst/nnstreamer/nnstreamer_conf.c +++ b/gst/nnstreamer/nnstreamer_conf.c @@ -254,12 +254,19 @@ _fill_in_vstr (gchar *** fullpath_vstr, gchar *** basename_vstr, { GSList *lstF = NULL, *lstB = NULL; vstr_helper vstrF, vstrB; - guint i, counter; + guint i, j, counter; counter = 0; for (i = 0; i < CONF_SOURCE_END; i++) { if (searchpath[i]) { - _get_filenames (type, searchpath[i], &lstF, &lstB, &counter); + /* skip duplicated paths */ + for (j = i + 1; j < CONF_SOURCE_END; j++) { + if (searchpath[j] && !g_strcmp0 (searchpath[i], searchpath[j])) { + break; + } + } + if (j == CONF_SOURCE_END) + _get_filenames (type, searchpath[i], &lstF, &lstB, &counter); } } -- 2.7.4