Skip to content

Commit

Permalink
Escape spaces in received filename.
Browse files Browse the repository at this point in the history
  • Loading branch information
MarkCallow committed Sep 19, 2024
1 parent 4a75536 commit 3d7d997
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions tests/loadtests/glloadtests/shader-based/GL3LoadTests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@
* OpenGL ES 3.x
*/

#include <string>
#include <regex>

#include "GLLoadTests.h"
#include "EncodeTexture.h"
#include "DrawTexture.h"
Expand Down Expand Up @@ -71,6 +74,9 @@ GLLoadTests::showFile(std::string& filename)
createViewer = DrawTexture::create;
}
ktxTexture_Destroy(kTexture);

// Escape any spaces in filename.
filename = std::regex_replace( filename, std::regex(" "), "\\ " );
std::string args = "--external " + filename;
pViewer = createViewer(w_width, w_height, args.c_str(), sBasePath);
return pViewer;
Expand Down

0 comments on commit 3d7d997

Please sign in to comment.