From b3cc1dc364fdb4961ce0af14858e7d74c9f470d8 Mon Sep 17 00:00:00 2001 From: "Carsten Haitzler (Rasterman)" Date: Wed, 27 May 2015 08:43:13 +0900 Subject: [PATCH] e start - path manipulation - don't add a : if there already is one avoids adding more : chars to make a broken path even worse --- src/bin/e_start_main.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/bin/e_start_main.c b/src/bin/e_start_main.c index d2a997a7e..475df235a 100644 --- a/src/bin/e_start_main.c +++ b/src/bin/e_start_main.c @@ -215,7 +215,7 @@ _env_path_prepend(const char *env, const char *path) strcat(s, p2); if (p) { - strcat(s, ":"); + if (p[0] != ':') strcat(s, ":"); strcat(s, p); } env_set(env, s); @@ -252,7 +252,10 @@ _env_path_append(const char *env, const char *path) if (p) { strcat(s, p); - strcat(s, ":"); + if (len > 0) + { + if (s[len - 1] != ':') strcat(s, ":"); + } } strcat(s, p2); env_set(env, s);