libcamera: utils: Use internal basename implementation.

Differing implementations of basename() exist, some of which may modify
the content of the string passed as an argument.

The implementation of basename() is trivial, thus to support different
C librariese, provide our own version which accepts and returns a const
char *.

Update the call sites to use the new implementation.

Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
This commit is contained in:
Kieran Bingham
2018-12-10 13:48:15 +00:00
parent abda899fa9
commit 0e1a809525
4 changed files with 55 additions and 1 deletions
+2
View File
@@ -15,6 +15,8 @@ namespace libcamera {
namespace utils {
const char *basename(const char *path);
/* C++11 doesn't provide std::make_unique */
template<typename T, typename... Args>
std::unique_ptr<T> make_unique(Args&&... args)