Christopher Reed 12 лет назад
Родитель
Сommit
fd2b37f9d1
1 измененных файлов с 2 добавлено и 1 удалено
  1. 2 1
      Player/Contents/Source/PolycodePlayer.cpp

+ 2 - 1
Player/Contents/Source/PolycodePlayer.cpp

@@ -448,7 +448,8 @@ static void dumpstack (lua_State *L) {
 
 		// MyLoader appends '.lua' so strip it if already present
 		int pos = fileName.rfind(".lua");
-		String stripped = (pos == fileName.length() - 4) ? fileName.substr(0, pos) : fileName;
+		String stripped = fileName;
+		if (pos > -1 && pos == fileName.length() - 4) stripped = fileName.substr(0, pos);
 		
 		lua_getfield(L, LUA_GLOBALSINDEX, "require");
 		lua_pushstring(L, stripped.c_str());