Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit8c940a3

Browse files
committed
If the MSVCRT module is not found in the current binary, proceed to update
system and local environments anyway, instead of aborting. (This willhappen in a MSVC build with no or very few external libraries linked in)
1 parente5b457c commit8c940a3

File tree

1 file changed

+14
-9
lines changed

1 file changed

+14
-9
lines changed

‎src/port/win32env.c

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
*
1111
*
1212
* IDENTIFICATION
13-
* $PostgreSQL: pgsql/src/port/win32env.c,v 1.3 2009/06/11 14:49:15 momjian Exp $
13+
* $PostgreSQL: pgsql/src/port/win32env.c,v 1.4 2009/12/27 16:01:39 mha Exp $
1414
*
1515
*-------------------------------------------------------------------------
1616
*/
@@ -40,15 +40,20 @@ pgwin32_putenv(const char *envval)
4040
if (putenvFunc==NULL)
4141
{
4242
hmodule=GetModuleHandle("msvcrt");
43-
if (hmodule==NULL)
44-
return1;
45-
putenvFunc= (PUTENVPROC)GetProcAddress(hmodule,"_putenv");
46-
if (putenvFunc==NULL)
47-
return1;
43+
if (hmodule!=NULL)
44+
{
45+
/*
46+
* If the module is found, attempt to find the function. If not, that just
47+
* means we're not linked with msvcrt, so fall through and make our other
48+
* modifications anyway.
49+
* Ignore any errors and update whatever we can, since callers don't
50+
* check the return value anyway.
51+
*/
52+
putenvFunc= (PUTENVPROC)GetProcAddress(hmodule,"_putenv");
53+
if (putenvFunc!=NULL)
54+
putenvFunc(envval);
55+
}
4856
}
49-
ret=putenvFunc(envval);
50-
if (ret!=0)
51-
returnret;
5257
#endif/* _MSC_VER >= 1300 */
5358

5459

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp