wmenu-run: Don't overwrite PATH
This commit is contained in:
parent
8f19d6a8d2
commit
e1816cc9a9
1 changed files with 2 additions and 1 deletions
|
@ -10,7 +10,7 @@
|
||||||
#include "xdg-activation-v1-client-protocol.h"
|
#include "xdg-activation-v1-client-protocol.h"
|
||||||
|
|
||||||
static void read_items(struct menu *menu) {
|
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, ":")) {
|
for (char *p = strtok(path, ":"); p != NULL; p = strtok(NULL, ":")) {
|
||||||
DIR *dir = opendir(p);
|
DIR *dir = opendir(p);
|
||||||
if (dir == NULL) {
|
if (dir == NULL) {
|
||||||
|
@ -24,6 +24,7 @@ static void read_items(struct menu *menu) {
|
||||||
}
|
}
|
||||||
closedir(dir);
|
closedir(dir);
|
||||||
}
|
}
|
||||||
|
free(path);
|
||||||
}
|
}
|
||||||
|
|
||||||
struct executable {
|
struct executable {
|
||||||
|
|
Loading…
Add table
Reference in a new issue