+#include <cstring>
#include <typeinfo>
#include <signal.h>
#include <msp/debug/demangle.h>
#include <msp/debug/errorreporter.h>
+#include <msp/fs/dir.h>
+#include <msp/fs/path.h>
#include <msp/fs/utils.h>
#include <msp/io/print.h>
#include "application.h"
if(argv0_)
throw logic_error("startup info already set");
- argv0_ = argv0;
+ static FS::Path exe;
+
+ bool has_slash = strchr(argv0, FS::DIRSEP);
+ if(!has_slash)
+ exe = FS::path_lookup(argv0);
+ if(exe.empty())
+ exe = FS::realpath(argv0);
+
+ argv0_ = exe.c_str();
data_ = data;
}