summaryrefslogtreecommitdiffhomepage
path: root/gui
diff options
context:
space:
mode:
Diffstat (limited to 'gui')
-rw-r--r--gui/main.cpp12
1 files changed, 8 insertions, 4 deletions
diff --git a/gui/main.cpp b/gui/main.cpp
index e34b4715..0d1ec06b 100644
--- a/gui/main.cpp
+++ b/gui/main.cpp
@@ -96,14 +96,18 @@ void add_win32_path()
// workaround QTBUG-38598, allow for launching from another directory
static void add_program_library_path()
{
- char* p = _pgmptr;
- char path[MAX_PATH+1];
- strcpy(path, p);
+ // Windows 10 allows for paths longer than MAX_PATH via fsutil and friends, shit
+ const char* p = _pgmptr;
+ char path[4096+1];
+
+ strncpy(path, p, sizeof(path)-1);
+ path[sizeof(path)-1] = '\0';
+
char* ptr = strrchr(path, '\\');
if (ptr)
{
*ptr = '\0';
- QCoreApplication::addLibraryPath(path);
+ QCoreApplication::setLibraryPaths({ path });
}
}
#endif