1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-27 12:41:57 +03:00

Use NAMEDATALEN instead of local define.

Modify path separators for Win32.

Per ideas from Takahiro Itagaki
This commit is contained in:
Bruce Momjian
2010-05-14 00:13:38 +00:00
parent 36d3afd2d4
commit e9ad14f9f4
5 changed files with 18 additions and 24 deletions

View File

@ -308,9 +308,13 @@ validateDirectoryOption(migratorContext *ctx, char **dirpath,
/*
* Trim off any trailing path separators
*/
if ((*dirpath)[strlen(*dirpath) - 1] == pathSeparator)
#ifndef WIN32
if ((*dirpath)[strlen(*dirpath) - 1] == '/')
#else
if ((*dirpath)[strlen(*dirpath) - 1] == '/' ||
(*dirpath)[strlen(*dirpath) - 1] == '\\')
#endif
(*dirpath)[strlen(*dirpath) - 1] = 0;
}