diff --git a/radiant/findtexturedialog.cpp b/radiant/findtexturedialog.cpp index 5bea3f7e..4b270ac5 100644 --- a/radiant/findtexturedialog.cpp +++ b/radiant/findtexturedialog.cpp @@ -45,6 +45,7 @@ #include "gtkutil/window.h" #include "stream/stringstream.h" +#include "os/path.h" #include "commands.h" #include "dialog.h" @@ -92,7 +93,7 @@ void FindTextureDialog_apply(){ StringOutputStream replace( 256 ); find << "textures/" << g_FindTextureDialog.m_strFind.c_str(); - replace << "textures/" << g_FindTextureDialog.m_strReplace.c_str(); + replace << "textures/" << PathCleaned( g_FindTextureDialog.m_strReplace.c_str() ); FindReplaceTextures( find.c_str(), replace.c_str(), g_FindTextureDialog.m_bSelectedOnly ); } diff --git a/radiant/surfacedialog.cpp b/radiant/surfacedialog.cpp index 19e4a752..324e4528 100644 --- a/radiant/surfacedialog.cpp +++ b/radiant/surfacedialog.cpp @@ -51,6 +51,7 @@ #include "texturelib.h" #include "shaderlib.h" #include "stringio.h" +#include "os/path.h" #include "gtkutil/idledraw.h" #include "gtkutil/dialog.h" @@ -1381,7 +1382,7 @@ void SurfaceInspector::Update(){ */ void SurfaceInspector::ApplyShader(){ StringOutputStream name( 256 ); - name << GlobalTexturePrefix_get() << gtk_entry_get_text( m_texture ); + name << GlobalTexturePrefix_get() << PathCleaned( gtk_entry_get_text( m_texture ) ); // TTimo: detect and refuse invalid texture names (at least the ones with spaces) if ( !texdef_name_valid( name.c_str() ) ) {