diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2004-08-09 16:26:06 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2004-08-09 16:26:06 +0000 |
commit | 35f539b481b5524bd331cb7b75df848da51b43e5 (patch) | |
tree | 3a303c0ede6081e2b3f5be39757b53703525b9fd /src/backend/access/transam/xlog.c | |
parent | 1109959907cbfe7d1ea510028c03ebac73f8b1e1 (diff) | |
download | postgresql-35f539b481b5524bd331cb7b75df848da51b43e5.tar.gz postgresql-35f539b481b5524bd331cb7b75df848da51b43e5.zip |
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.
Diffstat (limited to 'src/backend/access/transam/xlog.c')
-rw-r--r-- | src/backend/access/transam/xlog.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/backend/access/transam/xlog.c b/src/backend/access/transam/xlog.c index 1036365896f..28fb4c733a6 100644 --- a/src/backend/access/transam/xlog.c +++ b/src/backend/access/transam/xlog.c @@ -7,7 +7,7 @@ * Portions Copyright (c) 1996-2003, PostgreSQL Global Development Group * 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 */ sp++; StrNCpy(dp, xlogpath, endp-dp); +#ifndef WIN32 dp += strlen(dp); +#else + /* On Windows, change / to \ in the substituted path */ + while (*dp) + { + if (*dp == '/') + *dp = '\\'; + dp++; + } +#endif break; case 'f': /* %f: filename of desired file */ |