projects
/
libs
/
core.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
4f04dc8
)
Invent a value for argv[0] if not present
author
Mikko Rasa
<tdb@tdb.fi>
Sun, 9 Jun 2019 11:35:27 +0000
(14:35 +0300)
committer
Mikko Rasa
<tdb@tdb.fi>
Sun, 9 Jun 2019 12:09:33 +0000
(15:09 +0300)
Gdbserver seems to pass an empty argv[0], at least on Windows. That
causes problems with the various get_*_dir functions.
source/core/application.cpp
patch
|
blob
|
history
diff --git
a/source/core/application.cpp
b/source/core/application.cpp
index 1bae2cd68d06c1028c08e8690dbe585c79b6eb9c..aedaa4b6f25c027429f8bff1a5c069078206e7df 100644
(file)
--- a/
source/core/application.cpp
+++ b/
source/core/application.cpp
@@
-90,6
+90,15
@@
void Application::set_startup_info(const char *argv0, void *data)
static FS::Path exe;
+ if(!argv0 || !*argv0)
+ {
+#ifdef _WIN32
+ argv0 = "application.exe";
+#else
+ argv0 = "./application";
+#endif
+ }
+
bool has_slash = strchr(argv0, FS::DIRSEP);
if(!has_slash)
exe = FS::path_lookup(argv0);