mirror of
https://github.com/postgres/postgres.git
synced 2025-11-22 12:22:45 +03:00
Attached is a patch that takes care of the PATHSEP issue. I made a more
extensive change then what was suggested. I found the file path.c that contained a lot of "Unix/Windows" agnostic functions so I added a function there instead and removed the PATHSEP declaration in exec.c altogether. All to keep things from scattering all over the code. I also took the liberty of changing the name of the functions "first_path_sep" and "last_path_sep". Where I come from (and I'm apparently not alone given the former macro name PATHSEP), they should be called "first_dir_sep" and "last_dir_sep". The new function I introduced, that actually finds path separators, is now the "first_path_sep". The patch contains changes on all affected places of course. I also changed the documentation on dynamic_library_path to reflect the chagnes. Thomas Hallgren
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
/* $PostgreSQL: pgsql/src/interfaces/ecpg/ecpglib/connect.c,v 1.21 2004/03/15 16:27:43 momjian Exp $ */
|
||||
/* $PostgreSQL: pgsql/src/interfaces/ecpg/ecpglib/connect.c,v 1.22 2004/06/10 22:26:21 momjian Exp $ */
|
||||
|
||||
#define POSTGRES_ECPG_INTERNAL
|
||||
#include "postgres_fe.h"
|
||||
@@ -323,7 +323,7 @@ ECPGconnect(int lineno, int c, const char *name, const char *user, const char *p
|
||||
*tmp = '\0';
|
||||
}
|
||||
|
||||
tmp = last_path_separator(dbname + offset);
|
||||
tmp = last_dir_separator(dbname + offset);
|
||||
if (tmp != NULL) /* database name given */
|
||||
{
|
||||
realname = strdup(tmp + 1);
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* $PostgreSQL: pgsql/src/interfaces/ecpg/preproc/ecpg.c,v 1.87 2004/05/17 14:35:34 momjian Exp $ */
|
||||
/* $PostgreSQL: pgsql/src/interfaces/ecpg/preproc/ecpg.c,v 1.88 2004/06/10 22:26:23 momjian Exp $ */
|
||||
|
||||
/* New main for ecpg, the PostgreSQL embedded SQL precompiler. */
|
||||
/* (C) Michael Meskes <meskes@postgresql.org> Feb 5th, 1998 */
|
||||
@@ -268,7 +268,7 @@ main(int argc, char *const argv[])
|
||||
strcpy(input_filename, argv[fnr]);
|
||||
|
||||
/* take care of relative paths */
|
||||
ptr2ext = last_path_separator(input_filename);
|
||||
ptr2ext = last_dir_separator(input_filename);
|
||||
ptr2ext = (ptr2ext ? strrchr(ptr2ext, '.') : strrchr(input_filename, '.'));
|
||||
|
||||
/* no extension? */
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $PostgreSQL: pgsql/src/interfaces/libpq/fe-connect.c,v 1.273 2004/06/08 13:49:23 momjian Exp $
|
||||
* $PostgreSQL: pgsql/src/interfaces/libpq/fe-connect.c,v 1.274 2004/06/10 22:26:24 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -679,7 +679,7 @@ update_db_info(PGconn *conn)
|
||||
*tmp = '\0';
|
||||
}
|
||||
|
||||
tmp = last_path_separator(conn->dbName + offset);
|
||||
tmp = last_dir_separator(conn->dbName + offset);
|
||||
if (tmp != NULL) /* database name given */
|
||||
{
|
||||
if (conn->dbName)
|
||||
|
||||
Reference in New Issue
Block a user