mirror of
				https://github.com/postgres/postgres.git
				synced 2025-10-31 00:03:57 -04:00 
			
		
		
		
	Repair multiple breakage in Windows-specific code for appending '.exe'.
This commit is contained in:
		
							parent
							
								
									907855ac75
								
							
						
					
					
						commit
						cd7d748d51
					
				| @ -186,16 +186,10 @@ validate_exec(const char *dir, const char *cmdName) | ||||
| 	snprintf(path, sizeof(path), "%s/%s", dir, cmdName); | ||||
| 
 | ||||
| #ifdef WIN32 | ||||
| 	/* Win32 requires a .exe suffix for stat() */ | ||||
| 	char		path_exe[MAXPGPATH + sizeof(EXE_EXT) - 1]; | ||||
| 
 | ||||
| 	if (strlen(path) >= strlen(EXE_EXT) && | ||||
| 	/* Windows requires a .exe suffix for stat() */ | ||||
| 	if (strlen(path) <= strlen(EXE_EXT) || | ||||
| 		pg_strcasecmp(path + strlen(path) - strlen(EXE_EXT), EXE_EXT) != 0) | ||||
| 	{ | ||||
| 		strcpy(path_exe, path); | ||||
| 		strcat(path_exe, EXE_EXT); | ||||
| 		path = path_exe; | ||||
| 	} | ||||
| 		strlcat(path, EXE_EXT, sizeof(path)); | ||||
| #endif | ||||
| 
 | ||||
| 	/*
 | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user