libcamera: ipa_manager: Use utils::split()

Replace the custom string splitting implementation with utils::split().

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
[Kieran: Re-fit to master branch]
Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
This commit is contained in:
Laurent Pinchart
2020-02-06 22:42:30 +02:00
committed by Kieran Bingham
parent 53057c2a3e
commit 52774fff56
+6 -15
View File
@@ -110,22 +110,13 @@ IPAManager::IPAManager()
return;
}
const char *paths = modulePaths;
while (1) {
const char *delim = strchrnul(paths, ':');
size_t count = delim - paths;
for (const auto &dir : utils::split(modulePaths, ":")) {
if (dir.empty())
continue;
if (count) {
std::string path(paths, count);
ret = addDir(path.c_str());
if (ret > 0)
ipaCount += ret;
}
if (*delim == '\0')
break;
paths += count + 1;
int ret = addDir(dir.c_str());
if (ret > 0)
ipaCount += ret;
}
if (!ipaCount)