summaryrefslogtreecommitdiff
path: root/src/backend/storage/file/fd.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/backend/storage/file/fd.c')
-rw-r--r--src/backend/storage/file/fd.c28
1 files changed, 16 insertions, 12 deletions
diff --git a/src/backend/storage/file/fd.c b/src/backend/storage/file/fd.c
index 4a4a943e93..c64b7c0109 100644
--- a/src/backend/storage/file/fd.c
+++ b/src/backend/storage/file/fd.c
@@ -6,7 +6,7 @@
* Copyright (c) 1994, Regents of the University of California
*
* IDENTIFICATION
- * $Id: fd.c,v 1.26 1997/09/18 20:21:24 momjian Exp $
+ * $Id: fd.c,v 1.27 1997/11/07 06:38:15 thomas Exp $
*
* NOTES:
*
@@ -125,8 +125,6 @@ static Size SizeVfdCache = 0;
*/
static int nfile = 0;
-static char Sep_char = '/';
-
/*
* Private Routines
*
@@ -458,23 +456,25 @@ FreeVfd(File file)
VfdCache[0].nextFree = file;
}
+/* filepath()
+ * Open specified file name.
+ * Fill in absolute path fields if necessary.
+ *
+ * Modify to use GetDatabasePath() rather than hardcoded paths.
+ * - thomas 1997-11-02
+ */
static char *
filepath(char *filename)
{
char *buf;
- char basename[16];
int len;
- if (*filename != Sep_char)
+ /* Not an absolute path name? Then fill in with database path... */
+ if (*filename != SEP_CHAR)
{
- /* Either /base/ or \base\ */
- sprintf(basename, "%cbase%c", Sep_char, Sep_char);
-
- len = strlen(DataDir) + strlen(basename) + strlen(GetDatabaseName())
- + strlen(filename) + 2;
+ len = strlen(GetDatabasePath()) + strlen(filename) + 2;
buf = (char *) palloc(len);
- sprintf(buf, "%s%s%s%c%s",
- DataDir, basename, GetDatabaseName(), Sep_char, filename);
+ sprintf(buf, "%s%c%s", GetDatabasePath(), SEP_CHAR, filename);
}
else
{
@@ -482,6 +482,10 @@ filepath(char *filename)
strcpy(buf, filename);
}
+#ifdef FILEDEBUG
+printf("filepath: path is %s\n", buf);
+#endif
+
return (buf);
}