1
0
mirror of https://github.com/gryf/wmaker.git synced 2025-12-20 12:58:08 +01:00

real_main: Use setenv() instead of putenv() in remaining places

It simplifies the code a bit.
This commit is contained in:
Carlos R. Mafra
2009-08-17 22:42:38 +02:00
parent 6310e40d47
commit be0d694dc2

View File

@@ -593,7 +593,7 @@ static int
real_main(int argc, char **argv) real_main(int argc, char **argv)
{ {
int i, restart=0; int i, restart=0;
char *str, *pos; char *pos;
int d, s; int d, s;
int flag; int flag;
#ifdef DEBUG #ifdef DEBUG
@@ -721,8 +721,7 @@ real_main(int argc, char **argv)
if (Locale) { if (Locale) {
/* return of wstrconcat should not be free-ed! read putenv man page */ setenv("LANG", Locale, 1);
putenv(wstrconcat("LANG=", Locale));
} else { } else {
Locale = getenv("LC_ALL"); Locale = getenv("LC_ALL");
if (!Locale) { if (!Locale) {
@@ -793,12 +792,7 @@ real_main(int argc, char **argv)
multiHead = False; multiHead = False;
DisplayName = XDisplayName(DisplayName); DisplayName = XDisplayName(DisplayName);
{ setenv("DISPLAY", DisplayName, 1);
int len = strlen(DisplayName)+64;
str = wmalloc(len);
snprintf(str, len, "DISPLAY=%s", DisplayName);
}
putenv(str);
#ifdef DEBUG #ifdef DEBUG
if (doSync) if (doSync)