Commit 4232c465 authored by Alberts Muktupāvels's avatar Alberts Muktupāvels

mini-commander: simplify getting PATH environment variable

parent c4a99dbb
......@@ -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;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment