Commit 8e1984f8 authored by ussrhero's avatar ussrhero

fixed script path searching

parent 593d4037
......@@ -3,7 +3,7 @@
#define PYKDEXT_VERSION_MAJOR 2
#define PYKDEXT_VERSION_MINOR 0
#define PYKDEXT_VERSION_SUBVERSION 0
#define PYKDEXT_VERSION_BUILDNO 22
#define PYKDEXT_VERSION_BUILDNO 23
#define __VER_STR2__(x) #x
#define __VER_STR1__(x) __VER_STR2__(x)
......
......@@ -661,32 +661,22 @@ std::string getScriptFileName(const std::string &scriptName)
{
char* ext = NULL;
DWORD searchResult =
SearchPathA(
NULL,
scriptName.c_str(),
NULL,
0,
NULL,
NULL );
if ( searchResult == 0 )
if (scriptName.length() <= 3 || scriptName.find_last_of(".py") != scriptName.length() - 3 )
{
ext = ".py";
}
searchResult =
SearchPathA(
NULL,
scriptName.c_str(),
ext,
0,
NULL,
NULL );
DWORD searchResult = SearchPathA(
NULL,
scriptName.c_str(),
ext,
0,
NULL,
NULL);
if ( searchResult == 0 )
{
if ( searchResult == 0 )
{
return "";
}
}
std::vector<char> pathBuffer(searchResult);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment