Skip to content

Commit 7b93460

Browse files
committed
Fix by adding trailing slash
1 parent dd36754 commit 7b93460

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

src/LavaVu.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ LavaVu::LavaVu(std::string binpath, bool havecontext) : ViewerApp()
118118
#endif
119119
this->binpath = binpath;
120120

121-
if (FilePath::paths.size() == 0) FilePath::paths.push_back(binpath + "shaders/");
121+
if (FilePath::paths.size() == 0) FilePath::paths.push_back(binpath + "shaders");
122122
#ifdef SHADER_PATH
123123
FilePath::paths.push_back(SHADER_PATH);
124124
#endif

src/Shaders.cpp

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,8 +136,16 @@ std::string Shader::read_file(const std::string& fname)
136136
//std::cout << "TRY SHADER: " << filepath << std::endl;
137137
if (FileExists(filepath))
138138
break;
139-
else if (path.length() > 0)
139+
140+
if (path.length() > 0)
141+
{
142+
#if defined _WIN32
143+
if (path.back() != '\\') path += "\\";
144+
#else
145+
if (path.back() != '/') path += "/";
146+
#endif
140147
filepath = path + base_filename;
148+
}
141149
}
142150

143151
debug_print("Shader loading: %s\n", filepath.c_str());

0 commit comments

Comments
 (0)