diff --git a/src/main.cpp b/src/main.cpp index 89d949a..5c82337 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -128,9 +128,9 @@ std::string template_path(std::string backend_extension, std::string argv0) { char dirname_argv0[PATH_MAX], tmp[PATH_MAX]; memset(dirname_argv0, 0, sizeof(dirname_argv0)); - if (! realpath(argv0.c_str(), dirname_argv0)) + if (! realpath(argv0.c_str(), dirname_argv0) && ! realpath("/proc/self/exe", dirname_argv0)) { - fprintf(stderr, "Error resolving path %s: %s\n", argv0.c_str(), strerror(errno)); + fprintf(stderr, "Error resolving path to '%s': %s\n", argv0.c_str(), strerror(errno)); return ""; } char *sep = strrchr(dirname_argv0, '/');