mirror of
https://github.com/gryf/wmaker.git
synced 2025-12-20 04:48:06 +01:00
real_main: Use setenv() instead of putenv() in remaining places
It simplifies the code a bit.
This commit is contained in:
12
src/main.c
12
src/main.c
@@ -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)
|
||||||
|
|||||||
Reference in New Issue
Block a user