real_main: Use setenv() instead of putenv() in remaining places
It simplifies the code a little bit.
---
src/main.c | 12 +++---------
1 files changed, 3 insertions(+), 9 deletions(-)
diff --git a/src/main.c b/src/main.c
index 3d30ef7..d0e7598 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)
--
1.6.4.rc1.13.gec7b
--
To unsubscribe, send mail to [email protected].