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

Commitcd7d748

Browse files
committed
Repair multiple breakage in Windows-specific code for appending '.exe'.
1 parent907855a commitcd7d748

File tree

1 file changed

+3
-9
lines changed

1 file changed

+3
-9
lines changed

‎contrib/pg_upgrade/exec.c

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -186,16 +186,10 @@ validate_exec(const char *dir, const char *cmdName)
186186
snprintf(path,sizeof(path),"%s/%s",dir,cmdName);
187187

188188
#ifdefWIN32
189-
/* Win32 requires a .exe suffix for stat() */
190-
charpath_exe[MAXPGPATH+sizeof(EXE_EXT)-1];
191-
192-
if (strlen(path) >=strlen(EXE_EXT)&&
189+
/* Windows requires a .exe suffix for stat() */
190+
if (strlen(path) <=strlen(EXE_EXT)||
193191
pg_strcasecmp(path+strlen(path)-strlen(EXE_EXT),EXE_EXT)!=0)
194-
{
195-
strcpy(path_exe,path);
196-
strcat(path_exe,EXE_EXT);
197-
path=path_exe;
198-
}
192+
strlcat(path,EXE_EXT,sizeof(path));
199193
#endif
200194

201195
/*

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp