From be0d694dc2c1e86b931afc7b2cf0eff9f157b992 Mon Sep 17 00:00:00 2001 From: "Carlos R. Mafra" Date: Mon, 17 Aug 2009 22:42:38 +0200 Subject: [PATCH] real_main: Use setenv() instead of putenv() in remaining places It simplifies the code a bit. --- src/main.c | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/src/main.c b/src/main.c index 3d30ef71..d0e7598b 100644 --- a/src/main.c +++ b/src/main.c @@ -593,7 +593,7 @@ static int real_main(int argc, char **argv) { int i, restart=0; - char *str, *pos; + char *pos; int d, s; int flag; #ifdef DEBUG @@ -721,8 +721,7 @@ real_main(int argc, char **argv) if (Locale) { - /* return of wstrconcat should not be free-ed! read putenv man page */ - putenv(wstrconcat("LANG=", Locale)); + setenv("LANG", Locale, 1); } else { Locale = getenv("LC_ALL"); if (!Locale) { @@ -793,12 +792,7 @@ real_main(int argc, char **argv) multiHead = False; DisplayName = XDisplayName(DisplayName); - { - int len = strlen(DisplayName)+64; - str = wmalloc(len); - snprintf(str, len, "DISPLAY=%s", DisplayName); - } - putenv(str); + setenv("DISPLAY", DisplayName, 1); #ifdef DEBUG if (doSync) -- 2.11.4.GIT