From 94febdfe8758216bf5b16197dac8dd1b34e06d6d Mon Sep 17 00:00:00 2001 From: Jessica Hamilton Date: Sun, 20 Apr 2014 01:41:38 +1200 Subject: [PATCH] AboutSystem: use BPathFinder correctly --- src/apps/aboutsystem/AboutSystem.cpp | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/src/apps/aboutsystem/AboutSystem.cpp b/src/apps/aboutsystem/AboutSystem.cpp index 71405aefab..ec286556af 100644 --- a/src/apps/aboutsystem/AboutSystem.cpp +++ b/src/apps/aboutsystem/AboutSystem.cpp @@ -36,6 +36,7 @@ #include #include #include +#include #include #include #include @@ -1756,13 +1757,18 @@ status_t AboutView::_GetLicensePath(const char* license, BPath& path) { BPathFinder pathFinder; + BStringList paths; struct stat st; - status_t error = pathFinder.FindPath(B_FIND_PATH_DATA_DIRECTORY, - "licenses", path); - if (error == B_OK && path.Append(license) == B_OK - && lstat(path.Path(), &st) == 0) { - return B_OK; + status_t error = pathFinder.FindPaths(B_FIND_PATH_DATA_DIRECTORY, + "licenses", paths); + + for (int i = 0; i < paths.CountStrings(); ++i) { + if (error == B_OK && path.SetTo(paths.StringAt(i)) == B_OK + && path.Append(license) == B_OK + && lstat(path.Path(), &st) == 0) { + return B_OK; + } } path.Unset();