From ad4e1ac35fd0481936084ded4bcf0481a7515164 Mon Sep 17 00:00:00 2001 From: jackun Date: Sat, 20 Mar 2021 14:37:12 +0200 Subject: [PATCH] Try to get wine executable's name from /proc/self/comm --- src/file_utils.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/file_utils.cpp b/src/file_utils.cpp index b7fc978d..0a6f2936 100644 --- a/src/file_utils.cpp +++ b/src/file_utils.cpp @@ -119,7 +119,10 @@ std::string get_wine_exe_name(bool keep_ext) return std::string(); } - std::string line; + std::string line = read_line("/proc/self/comm"); // max 16 characters though + if (ends_with(line, ".exe", true)) + return line; + std::ifstream cmdline("/proc/self/cmdline"); // Iterate over arguments (separated by NUL byte). while (std::getline(cmdline, line, '\0')) {