diff options
author | Bruce Momjian <bruce@momjian.us> | 2004-08-12 18:32:52 +0000 |
---|---|---|
committer | Bruce Momjian <bruce@momjian.us> | 2004-08-12 18:32:52 +0000 |
commit | 6525b42b10c4e05fade5dfd147b59ed14073b0e6 (patch) | |
tree | 98b1371bd51f87f4fb33b88f2194c556335965f1 /src/port/path.c | |
parent | e48322a6d6cfce1ec52ab303441df329ddbc04d1 (diff) | |
download | postgresql-6525b42b10c4e05fade5dfd147b59ed14073b0e6.tar.gz postgresql-6525b42b10c4e05fade5dfd147b59ed14073b0e6.zip |
Add make_native_path() because Win32 COPY is an internal CMD.EXE command
and doesn't process forward slashes in the same way as external
commands. Quoting the first argument to COPY does not convert forward
to backward slashes, but COPY does properly process quoted forward
slashes in the second argument.
Win32 COPY works with quoted forward slashes in the first argument only if the
current directory is the same as the directory of the first argument.
Diffstat (limited to 'src/port/path.c')
-rw-r--r-- | src/port/path.c | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/src/port/path.c b/src/port/path.c index 040c8a6eb72..2a7428d0ba6 100644 --- a/src/port/path.c +++ b/src/port/path.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $PostgreSQL: pgsql/src/port/path.c,v 1.27 2004/08/09 20:20:46 tgl Exp $ + * $PostgreSQL: pgsql/src/port/path.c,v 1.28 2004/08/12 18:32:52 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -88,6 +88,23 @@ last_dir_separator(const char *filename) /* + * make_native_path + * On WIN32, change / to \ in the path. + */ +void +make_native_path(char *filename) +{ +#ifdef WIN32 + char *p; + + for (p = filename; *p; p++) + if (*p == '/') + *p = '\\'; +#endif +} + + +/* * Make all paths look like Unix */ void |