summaryrefslogtreecommitdiffstats
path: root/filescan-utils.c
diff options
context:
space:
mode:
authorJonathan Aillet <jonathan.aillet@iot.bzh>2018-07-02 19:50:12 +0200
committerStéphane Desneux <stephane.desneux@iot.bzh>2018-07-03 16:16:59 +0000
commit5811a53c29db2ee703b9eb5b6b303287a65f3f04 (patch)
tree5a3bb3cd37ede653b83b4ac19e76ee6e3d8ae53b /filescan-utils.c
parent2c29f154a70c2ac7f4f5fc8beda75734a15538c5 (diff)
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 <jonathan.aillet@iot.bzh>
Diffstat (limited to 'filescan-utils.c')
-rw-r--r--filescan-utils.c2
1 files changed, 1 insertions, 1 deletions
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;