- ported bugfixes to trunk from 3.6.0.3

This commit is contained in:
Mark Vejvoda
2012-01-24 21:28:05 +00:00
11 changed files with 55 additions and 26 deletions

View File

@@ -500,6 +500,13 @@ void endPathWithSlash(string &path,bool requireOSSlash) {
}
}
string formatPath(string path) {
replaceAll(path, "\"", "");
replaceAll(path, "//", "/");
return path;
}
void trimPathWithStartingSlash(string &path) {
if(StartsWith(path, "/") == true || StartsWith(path, "\\") == true) {
path.erase(path.begin(),path.begin()+1);

View File

@@ -15,6 +15,11 @@
#include "platform_common.h"
#include "libircclient.h"
// upstream moved some defines into new headers as of 1.6
#ifndef LIBIRCCLIENT_PRE1_6
#include "libirc_rfcnumeric.h"
#endif
#include <stdio.h>
#include <stdarg.h>
#include <string.h>

View File

@@ -79,11 +79,11 @@ void PlatformContextGl::init(int colorBits, int depthBits, int stencilBits,
#ifndef WIN32
string mg_icon_file = "";
#if defined(CUSTOM_DATA_INSTALL_PATH_VALUE)
if(fileExists(CUSTOM_DATA_INSTALL_PATH_VALUE + "megaglest.png")) {
mg_icon_file = CUSTOM_DATA_INSTALL_PATH_VALUE + "megaglest.png";
if(fileExists(formatPath(TOSTRING(CUSTOM_DATA_INSTALL_PATH_VALUE)) + "megaglest.png")) {
mg_icon_file = formatPath(TOSTRING(CUSTOM_DATA_INSTALL_PATH_VALUE)) + "megaglest.png";
}
else if(fileExists(CUSTOM_DATA_INSTALL_PATH_VALUE + "megaglest.bmp")) {
mg_icon_file = CUSTOM_DATA_INSTALL_PATH_VALUE + "megaglest.bmp";
else if(fileExists(formatPath(TOSTRING(CUSTOM_DATA_INSTALL_PATH_VALUE)) + "megaglest.bmp")) {
mg_icon_file = formatPath(TOSTRING(CUSTOM_DATA_INSTALL_PATH_VALUE)) + "megaglest.bmp";
}
#endif