From 5811a53c29db2ee703b9eb5b6b303287a65f3f04 Mon Sep 17 00:00:00 2001 From: Jonathan Aillet Date: Mon, 2 Jul 2018 19:50:12 +0200 Subject: At search, use the prefix parameter as a prefix Be sure that prefix parameter is used as a prefix when searching for configuration files (when using 'ScanForConfig' function). Before this change, the function was only checking that the prefix parameter was present in the file name (but not necessarily at the beginning of the file name). Bug-AGL:SPEC-1239 Change-Id: I9986cce5fab0fd5cd6d3049731f4c5883056a5f4 Signed-off-by: Jonathan Aillet --- filescan-utils.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'filescan-utils.c') diff --git a/filescan-utils.c b/filescan-utils.c index 22af147..a6111c1 100644 --- a/filescan-utils.c +++ b/filescan-utils.c @@ -61,7 +61,7 @@ static int ScanDir(char* searchPath, CtlScanDirModeT mode, size_t extentionLen, ssize_t extentionIdx = strlen(dirEnt->d_name) - extentionLen; if (extentionIdx <= 0) continue; - if (prefix && !strcasestr(dirEnt->d_name, prefix)) + if (prefix && strncasecmp(dirEnt->d_name, prefix, strlen(prefix))) continue; if (extention && strcasecmp(extention, &dirEnt->d_name[extentionIdx])) continue; -- cgit 1.2.3-korg