wmenu-run: Don't overwrite PATH - wmenu - 🔧 fork of wmenu
 (HTM) git clone git@git.drkhsh.at/wmenu.git
 (DIR) Log
 (DIR) Files
 (DIR) Refs
 (DIR) README
 (DIR) LICENSE
       ---
 (DIR) commit e1816cc9a9ab7887dc2aa10b6244055546111049
 (DIR) parent 8f19d6a8d2f34aeb4060d4374eb204b270ffbaa8
 (HTM) Author: adnano <me@adnano.co>
       Date:   Fri,  3 May 2024 19:31:11 -0400
       
       wmenu-run: Don't overwrite PATH
       
       Diffstat:
         M wmenu-run.c                         |       3 ++-
       
       1 file changed, 2 insertions(+), 1 deletion(-)
       ---
 (DIR) diff --git a/wmenu-run.c b/wmenu-run.c
       @@ -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 {