Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
emacs
emacs
Commits
892eb237
Commit
892eb237
authored
May 19, 2006
by
Eli Zaretskii
Browse files
(init_environment): Simplify code that calls ExpandEnvironmentStrings and make
buf1[] and buf2[] more visible for easier debugging.
parent
e00b99c8
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
11 deletions
+8
-11
src/w32.c
src/w32.c
+8
-11
No files found.
src/w32.c
View file @
892eb237
...
...
@@ -1095,20 +1095,17 @@ init_environment (char ** argv)
if
(
lpval
)
{
if
(
dwType
==
REG_EXPAND_SZ
)
{
char
buf1
[
SET_ENV_BUF_SIZE
],
buf2
[
SET_ENV_BUF_SIZE
];
char
buf1
[
SET_ENV_BUF_SIZE
],
buf2
[
SET_ENV_BUF_SIZE
];
ExpandEnvironmentStrings
((
LPSTR
)
lpval
,
buf1
,
sizeof
(
buf1
));
_snprintf
(
buf2
,
sizeof
(
buf2
)
-
1
,
"%s=%s"
,
env_vars
[
i
].
name
,
buf1
);
_putenv
(
strdup
(
buf2
));
}
if
(
dwType
==
REG_EXPAND_SZ
)
ExpandEnvironmentStrings
((
LPSTR
)
lpval
,
buf1
,
sizeof
(
buf1
));
else
if
(
dwType
==
REG_SZ
)
strcpy
(
buf1
,
lpval
);
if
(
dwType
==
REG_EXPAND_SZ
||
dwType
==
REG_SZ
)
{
char
buf
[
SET_ENV_BUF_SIZE
];
_snprintf
(
buf
,
sizeof
(
buf
)
-
1
,
"%s=%s"
,
env_vars
[
i
].
name
,
lpval
);
_putenv
(
strdup
(
buf
));
_snprintf
(
buf2
,
sizeof
(
buf2
)
-
1
,
"%s=%s"
,
env_vars
[
i
].
name
,
buf1
);
_putenv
(
strdup
(
buf2
));
}
if
(
!
dont_free
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment