mirror of
				https://github.com/postgres/postgres.git
				synced 2025-11-04 00:02:52 -05:00 
			
		
		
		
	When expanding %p in archive_command or restore_command, translate
slashes to backslashes #ifdef WIN32. This is to cope with the fact that Windows seems exceedingly unfriendly to slashes in shell commands, as per recent discussion.
This commit is contained in:
		
							parent
							
								
									1109959907
								
							
						
					
					
						commit
						35f539b481
					
				@ -7,7 +7,7 @@
 | 
				
			|||||||
 * Portions Copyright (c) 1996-2003, PostgreSQL Global Development Group
 | 
					 * Portions Copyright (c) 1996-2003, PostgreSQL Global Development Group
 | 
				
			||||||
 * Portions Copyright (c) 1994, Regents of the University of California
 | 
					 * Portions Copyright (c) 1994, Regents of the University of California
 | 
				
			||||||
 *
 | 
					 *
 | 
				
			||||||
 * $PostgreSQL: pgsql/src/backend/access/transam/xlog.c,v 1.157 2004/08/08 03:22:08 tgl Exp $
 | 
					 * $PostgreSQL: pgsql/src/backend/access/transam/xlog.c,v 1.158 2004/08/09 16:26:01 tgl Exp $
 | 
				
			||||||
 *
 | 
					 *
 | 
				
			||||||
 *-------------------------------------------------------------------------
 | 
					 *-------------------------------------------------------------------------
 | 
				
			||||||
 */
 | 
					 */
 | 
				
			||||||
@ -1962,7 +1962,17 @@ RestoreArchivedFile(char *path, const char *xlogfname,
 | 
				
			|||||||
					/* %p: full path of target file */
 | 
										/* %p: full path of target file */
 | 
				
			||||||
					sp++;
 | 
										sp++;
 | 
				
			||||||
					StrNCpy(dp, xlogpath, endp-dp);
 | 
										StrNCpy(dp, xlogpath, endp-dp);
 | 
				
			||||||
 | 
					#ifndef WIN32
 | 
				
			||||||
					dp += strlen(dp);
 | 
										dp += strlen(dp);
 | 
				
			||||||
 | 
					#else
 | 
				
			||||||
 | 
										/* On Windows, change / to \ in the substituted path */
 | 
				
			||||||
 | 
										while (*dp)
 | 
				
			||||||
 | 
										{
 | 
				
			||||||
 | 
											if (*dp == '/')
 | 
				
			||||||
 | 
												*dp = '\\';
 | 
				
			||||||
 | 
											dp++;
 | 
				
			||||||
 | 
										}
 | 
				
			||||||
 | 
					#endif
 | 
				
			||||||
					break;
 | 
										break;
 | 
				
			||||||
				case 'f':
 | 
									case 'f':
 | 
				
			||||||
					/* %f: filename of desired file */
 | 
										/* %f: filename of desired file */
 | 
				
			||||||
 | 
				
			|||||||
@ -19,7 +19,7 @@
 | 
				
			|||||||
 *
 | 
					 *
 | 
				
			||||||
 *
 | 
					 *
 | 
				
			||||||
 * IDENTIFICATION
 | 
					 * IDENTIFICATION
 | 
				
			||||||
 *	  $PostgreSQL: pgsql/src/backend/postmaster/pgarch.c,v 1.5 2004/08/05 23:32:10 tgl Exp $
 | 
					 *	  $PostgreSQL: pgsql/src/backend/postmaster/pgarch.c,v 1.6 2004/08/09 16:26:06 tgl Exp $
 | 
				
			||||||
 *
 | 
					 *
 | 
				
			||||||
 *-------------------------------------------------------------------------
 | 
					 *-------------------------------------------------------------------------
 | 
				
			||||||
 */
 | 
					 */
 | 
				
			||||||
@ -436,7 +436,17 @@ pgarch_archiveXlog(char *xlog)
 | 
				
			|||||||
					/* %p: full path of source file */
 | 
										/* %p: full path of source file */
 | 
				
			||||||
					sp++;
 | 
										sp++;
 | 
				
			||||||
					StrNCpy(dp, pathname, endp-dp);
 | 
										StrNCpy(dp, pathname, endp-dp);
 | 
				
			||||||
 | 
					#ifndef WIN32
 | 
				
			||||||
					dp += strlen(dp);
 | 
										dp += strlen(dp);
 | 
				
			||||||
 | 
					#else
 | 
				
			||||||
 | 
										/* On Windows, change / to \ in the substituted path */
 | 
				
			||||||
 | 
										while (*dp)
 | 
				
			||||||
 | 
										{
 | 
				
			||||||
 | 
											if (*dp == '/')
 | 
				
			||||||
 | 
												*dp = '\\';
 | 
				
			||||||
 | 
											dp++;
 | 
				
			||||||
 | 
										}
 | 
				
			||||||
 | 
					#endif
 | 
				
			||||||
					break;
 | 
										break;
 | 
				
			||||||
				case 'f':
 | 
									case 'f':
 | 
				
			||||||
					/* %f: filename of source file */
 | 
										/* %f: filename of source file */
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user