mirror of
https://github.com/Llewellynvdm/conky.git
synced 2024-12-26 04:17:33 +00:00
Unbreak alias stuff.
It was broken by commit 98c64d8b3e
, I did
a lowsy job of checking the patch over.
This commit is contained in:
parent
21e9964c5a
commit
41b62122f5
53
src/conky.c
53
src/conky.c
@ -2805,35 +2805,36 @@ static int extract_variable_text_internal(struct text_object *retval, const char
|
||||
var = getenv(buf);
|
||||
|
||||
/* if variable wasn't found in environment, use some special */
|
||||
if (!var) {
|
||||
arg = 0;
|
||||
if (var) {
|
||||
strncpy(buf, var, 255);
|
||||
}
|
||||
arg = 0;
|
||||
|
||||
/* split arg */
|
||||
if (strchr(buf, ' ')) {
|
||||
arg = strchr(buf, ' ');
|
||||
*arg = '\0';
|
||||
/* split arg */
|
||||
if (strchr(buf, ' ')) {
|
||||
arg = strchr(buf, ' ');
|
||||
*arg = '\0';
|
||||
arg++;
|
||||
while (isspace((int) *arg)) {
|
||||
arg++;
|
||||
while (isspace((int) *arg)) {
|
||||
arg++;
|
||||
}
|
||||
if (!*arg) {
|
||||
arg = 0;
|
||||
}
|
||||
}
|
||||
if (!*arg) {
|
||||
arg = 0;
|
||||
}
|
||||
}
|
||||
|
||||
/* lowercase variable name */
|
||||
tmp_p = buf;
|
||||
while (*tmp_p) {
|
||||
*tmp_p = tolower(*tmp_p);
|
||||
tmp_p++;
|
||||
}
|
||||
/* lowercase variable name */
|
||||
tmp_p = buf;
|
||||
while (*tmp_p) {
|
||||
*tmp_p = tolower(*tmp_p);
|
||||
tmp_p++;
|
||||
}
|
||||
|
||||
obj = construct_text_object(buf, arg,
|
||||
line, allow_threaded,
|
||||
&ifblock_opaque);
|
||||
if (obj != NULL) {
|
||||
append_object(retval, obj);
|
||||
}
|
||||
obj = construct_text_object(buf, arg,
|
||||
line, allow_threaded,
|
||||
&ifblock_opaque);
|
||||
if (obj != NULL) {
|
||||
append_object(retval, obj);
|
||||
}
|
||||
continue;
|
||||
} else {
|
||||
@ -7313,9 +7314,9 @@ static void load_config_file(const char *f)
|
||||
|
||||
CONF("alias") {
|
||||
if (value) {
|
||||
char skey[256], svalue[256];
|
||||
char skey[1024], svalue[1024];
|
||||
char *oldvalue;
|
||||
if (sscanf(value, "%255[0-9a-zA-Z_] %255[^\n]", skey, svalue) == 2) {
|
||||
if (sscanf(value, "%1023[0-9a-zA-Z_] %1023[^\n]", skey, svalue) == 2) {
|
||||
oldvalue = getenv(skey);
|
||||
if (oldvalue == NULL) {
|
||||
setenv(skey, svalue, 0);
|
||||
|
Loading…
Reference in New Issue
Block a user