From 30fe9697dfd7276a8d18cdecde9809eeec80bf0d Mon Sep 17 00:00:00 2001 From: Dana Jansens Date: Tue, 25 Jan 2011 13:32:43 -0500 Subject: [PATCH 1/1] skip empty strings when splitting paths in the environment --- obt/paths.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/obt/paths.c b/obt/paths.c index d2e230d..aa76b8e 100644 --- a/obt/paths.c +++ b/obt/paths.c @@ -88,8 +88,10 @@ static GSList* split_paths(const gchar *paths) if (!paths) return NULL; spl = g_strsplit(paths, ":", -1); - for (it = spl; *it; ++it) - list = slist_path_add(list, *it, (GSListFunc) g_slist_append); + for (it = spl; *it; ++it) { + if ((*it)[0]) /* skip empty strings */ + list = slist_path_add(list, *it, (GSListFunc) g_slist_append); + } g_free(spl); return list; } -- 1.9.1