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>
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;