wmenu-run: Don't overwrite PATH

This commit is contained in:
adnano 2024-05-03 19:31:11 -04:00
parent 8f19d6a8d2
commit e1816cc9a9

View file

@ -10,7 +10,7 @@
#include "xdg-activation-v1-client-protocol.h"
static void read_items(struct menu *menu) {
char *path = getenv("PATH");
char *path = strdup(getenv("PATH"));
for (char *p = strtok(path, ":"); p != NULL; p = strtok(NULL, ":")) {
DIR *dir = opendir(p);
if (dir == NULL) {
@ -24,6 +24,7 @@ static void read_items(struct menu *menu) {
}
closedir(dir);
}
free(path);
}
struct executable {