Invent a value for argv[0] if not present
[libs/core.git] / source / core / application.cpp
index 1bae2cd68d06c1028c08e8690dbe585c79b6eb9c..aedaa4b6f25c027429f8bff1a5c069078206e7df 100644 (file)
@@ -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);