From fb8ccd7a05847c19a863be785d1786846671a1c9 Mon Sep 17 00:00:00 2001 From: Phil Sutter Date: Sun, 26 Apr 2009 22:38:03 +0200 Subject: [PATCH] fix for enviroment variable expansion --- src/conky.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/conky.c b/src/conky.c index 5ea77a59..8d2adf96 100644 --- a/src/conky.c +++ b/src/conky.c @@ -2825,13 +2825,17 @@ static int extract_variable_text_internal(struct text_object *retval, const char } s = p; + /* search for variable in environment */ + var = getenv(buf); + if (var) { + obj = create_plain_text(var); + if (obj) + append_object(retval, obj); + continue; + } /* if variable wasn't found in environment, use some special */ - if (var) { - strncpy(buf, var, 255); - } - arg = 0; /* split arg */ if (strchr(buf, ' ')) {