diff --git a/kobo-dotfile-hack/hidedir.c b/kobo-dotfile-hack/hidedir.c index c78e910..c63cb38 100644 --- a/kobo-dotfile-hack/hidedir.c +++ b/kobo-dotfile-hack/hidedir.c @@ -12,6 +12,9 @@ #include #include +// NOTE: GNU extension! +extern char* program_invocation_short_name; + #define constructor __attribute__((constructor)) static bool wrap = true; @@ -40,11 +43,7 @@ static char* dirpaths[1024] = { 0 }; // Linux default is 102 static bool isproc(const char* proc) { - char buf[PATH_MAX] = { 0 }; - if (readlink("/proc/self/exe", buf, PATH_MAX) != -1) { - return strcmp(strrchr(buf, '/') + 1, proc) == 0; - } - return false; + return strcmp(program_invocation_short_name, proc) == 0; } #endif