From: Steinar H. Gunderson Date: Wed, 12 Apr 2017 16:58:28 +0000 (+0200) Subject: Make search_for_file() understand absolute paths. X-Git-Tag: 1.6.0~62 X-Git-Url: https://git.sesse.net/?a=commitdiff_plain;h=960b096ad2763e4296b9392e634bb6ab4896032f;p=nageru Make search_for_file() understand absolute paths. --- diff --git a/image_input.cpp b/image_input.cpp index 92c58ec..e763ad5 100644 --- a/image_input.cpp +++ b/image_input.cpp @@ -39,6 +39,11 @@ using namespace std; string search_for_file(const string &filename) { + if (!filename.empty() && filename[0] == '/') { + // Absolute path. + return filename; + } + // Look for the file in all theme_dirs until we find one; // that will be the permanent resolution of this file, whether // it is actually valid or not.