From d1c820e0f36a9a55223a2b41f833e635f1415ca2 Mon Sep 17 00:00:00 2001 From: Stefan Seyfried Date: Sun, 13 Dec 2015 18:20:13 +0100 Subject: [PATCH] framebuffer_ng: make setIconBasePath more robust ...by appending a slash if the caller doesn't supply one. Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/e8ff0c7d09348939052ac548f4cbc871d466bc78 Author: Stefan Seyfried Date: 2015-12-13 (Sun, 13 Dec 2015) ------------------ This commit was generated by Migit --- src/driver/framebuffer_ng.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/driver/framebuffer_ng.cpp b/src/driver/framebuffer_ng.cpp index 52ae8dabb..8d2e43b13 100644 --- a/src/driver/framebuffer_ng.cpp +++ b/src/driver/framebuffer_ng.cpp @@ -713,6 +713,9 @@ void CFrameBuffer::paintHLineRel(int x, int dx, int y, const fb_pixel_t col) void CFrameBuffer::setIconBasePath(const std::string & iconPath) { iconBasePath = iconPath; + if (!iconBasePath.empty() && '/' == *iconBasePath.rbegin()) /* .back() is only c++11 :-( */ + return; + iconBasePath += "/"; } void CFrameBuffer::getIconSize(const char * const filename, int* width, int *height)