[gnome-applets] mini-commander: simplify getting PATH environment variable



commit 4232c4651d3248d73c772ce9f8f7992a9ee405fd
Author: Alberts Muktupāvels <alberts muktupavels gmail com>
Date:   Sun Apr 5 02:55:14 2020 +0300

    mini-commander: simplify getting PATH environment variable

 gnome-applets/mini-commander/cmd-completion.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
---
diff --git a/gnome-applets/mini-commander/cmd-completion.c b/gnome-applets/mini-commander/cmd-completion.c
index 20e0a828f..40a5a72d2 100644
--- a/gnome-applets/mini-commander/cmd-completion.c
+++ b/gnome-applets/mini-commander/cmd-completion.c
@@ -134,9 +134,8 @@ cmdc( char *s )
    {
       /* Make a local copy of the path variable. Otherwise the path
          environment variable would be modified. */
-      path = (char *) malloc(sizeof(char) * (strlen(getenv("PATH")) + 1));
-      strcpy(path, getenv("PATH"));
-      
+      path = g_strdup (g_getenv ("PATH"));
+
       path_hash = g_hash_table_new( g_str_hash, g_str_equal );
 
       for( path_elem = strtok( path, ":" ); path_elem;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]