diff options
Diffstat (limited to 'src/interfaces')
-rw-r--r-- | src/interfaces/ecpg/ecpglib/connect.c | 4 | ||||
-rw-r--r-- | src/interfaces/ecpg/preproc/ecpg.c | 9 | ||||
-rw-r--r-- | src/interfaces/libpq/fe-connect.c | 8 |
3 files changed, 9 insertions, 12 deletions
diff --git a/src/interfaces/ecpg/ecpglib/connect.c b/src/interfaces/ecpg/ecpglib/connect.c index 5c3c096dd57..69433bdc4b1 100644 --- a/src/interfaces/ecpg/ecpglib/connect.c +++ b/src/interfaces/ecpg/ecpglib/connect.c @@ -1,4 +1,4 @@ -/* $Header: /cvsroot/pgsql/src/interfaces/ecpg/ecpglib/connect.c,v 1.1 2003/03/16 10:42:53 meskes Exp $ */ +/* $Header: /cvsroot/pgsql/src/interfaces/ecpg/ecpglib/connect.c,v 1.2 2003/04/04 20:42:13 momjian Exp $ */ #include "postgres_fe.h" @@ -326,7 +326,7 @@ ECPGconnect(int lineno, const char *name, const char *user, const char *passwd, *tmp = '\0'; } - tmp = strrchr(dbname + offset, '/'); + tmp = last_path_separator(dbname + offset); if (tmp != NULL) /* database name given */ { realname = strdup(tmp + 1); diff --git a/src/interfaces/ecpg/preproc/ecpg.c b/src/interfaces/ecpg/preproc/ecpg.c index d3b61525dd8..fa35b30e7f5 100644 --- a/src/interfaces/ecpg/preproc/ecpg.c +++ b/src/interfaces/ecpg/preproc/ecpg.c @@ -1,4 +1,4 @@ -/* $Header: /cvsroot/pgsql/src/interfaces/ecpg/preproc/ecpg.c,v 1.64 2003/03/27 14:29:17 meskes Exp $ */ +/* $Header: /cvsroot/pgsql/src/interfaces/ecpg/preproc/ecpg.c,v 1.65 2003/04/04 20:42:13 momjian Exp $ */ /* New main for ecpg, the PostgreSQL embedded SQL precompiler. */ /* (C) Michael Meskes <meskes@postgresql.org> Feb 5th, 1998 */ @@ -105,10 +105,7 @@ main(int argc, char *const argv[]) struct _include_path *ip; char *progname; - if (!strrchr(argv[0], '/')) - progname = argv[0]; - else - progname = strrchr(argv[0], '/') + 1; + progname = get_progname(argv[0]); if (argc > 1) { @@ -213,7 +210,7 @@ main(int argc, char *const argv[]) strcpy(input_filename, argv[fnr]); /* take care of relative paths */ - ptr2ext = strrchr(input_filename, '/'); + ptr2ext = last_path_separator(input_filename); ptr2ext = (ptr2ext ? strrchr(ptr2ext, '.') : strrchr(input_filename, '.')); /* no extension? */ diff --git a/src/interfaces/libpq/fe-connect.c b/src/interfaces/libpq/fe-connect.c index 3d938031efe..f2e509e6246 100644 --- a/src/interfaces/libpq/fe-connect.c +++ b/src/interfaces/libpq/fe-connect.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/interfaces/libpq/fe-connect.c,v 1.230 2003/04/02 00:49:28 tgl Exp $ + * $Header: /cvsroot/pgsql/src/interfaces/libpq/fe-connect.c,v 1.231 2003/04/04 20:42:13 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -330,7 +330,7 @@ PQconnectStart(const char *conninfo) /* * Allow unix socket specification in the host name */ - if (conn->pghost && conn->pghost[0] == '/') + if (conn->pghost && is_absolute_path(conn->pghost)) { if (conn->pgunixsocket) free(conn->pgunixsocket); @@ -449,7 +449,7 @@ PQsetdbLogin(const char *pghost, const char *pgport, const char *pgoptions, * We don't allow unix socket path as a function parameter. This * allows unix socket specification in the host name. */ - if (conn->pghost && conn->pghost[0] == '/') + if (conn->pghost && is_absolute_path(conn->pghost)) { if (conn->pgunixsocket) free(conn->pgunixsocket); @@ -604,7 +604,7 @@ update_db_info(PGconn *conn) *tmp = '\0'; } - tmp = strrchr(conn->dbName + offset, '/'); + tmp = last_path_separator(conn->dbName + offset); if (tmp != NULL) /* database name given */ { if (conn->dbName) |