char path[MAXPGPATH];
const char *errMsg;
- snprintf(path, sizeof(path), "%s%c%s", dir, pathSeparator, cmdName);
+ snprintf(path, sizeof(path), "%s/%s", dir, cmdName);
if ((errMsg = validate_exec(path)) == NULL)
return 1; /* 1 -> first alternative OK */
{
struct stat statBuf;
- snprintf(subDirName, sizeof(subDirName), "%s%c%s", pg_data,
- pathSeparator, requiredSubdirs[subdirnum]);
+ snprintf(subDirName, sizeof(subDirName), "%s/%s", pg_data,
+ requiredSubdirs[subdirnum]);
if ((stat(subDirName, &statBuf)) != 0)
{
/*
* 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;
-
}
#include "libpq-fe.h"
/* Allocate for null byte */
-#define NAMEDATASIZE (NAMEDATALEN + 1)
-
#define USER_NAME_SIZE 128
#define MAX_STRING 1024
extern void copydir(char *fromdir, char *todir, bool recurse);
extern bool rmtree(const char *path, bool rmtopdir);
-extern char pathSeparator;
-
/*
* Each relation is represented by a relinfo structure.
*/
typedef struct
{
- char nspname[NAMEDATASIZE]; /* namespace name */
- char relname[NAMEDATASIZE]; /* relation name */
+ char nspname[NAMEDATALEN]; /* namespace name */
+ char relname[NAMEDATALEN]; /* relation name */
Oid reloid; /* relation oid */
Oid relfilenode; /* relation relfile node */
Oid toastrelid; /* oid of the toast relation */
Oid new; /* Relfilenode of the new relation */
char old_file[MAXPGPATH];
char new_file[MAXPGPATH];
- char old_nspname[NAMEDATASIZE]; /* old name of the namespace */
- char old_relname[NAMEDATASIZE]; /* old name of the relation */
- char new_nspname[NAMEDATASIZE]; /* new name of the namespace */
- char new_relname[NAMEDATASIZE]; /* new name of the relation */
+ char old_nspname[NAMEDATALEN]; /* old name of the namespace */
+ char old_relname[NAMEDATALEN]; /* old name of the relation */
+ char new_nspname[NAMEDATALEN]; /* new name of the namespace */
+ char new_relname[NAMEDATALEN]; /* new name of the relation */
} FileNameMap;
/*
typedef struct
{
Oid db_oid; /* oid of the database */
- char db_name[NAMEDATASIZE]; /* database name */
+ char db_name[NAMEDATALEN]; /* database name */
char db_tblspace[MAXPGPATH]; /* database default tablespace path */
RelInfoArr rel_arr; /* array of all user relinfos */
} DbInfo;