aboutsummaryrefslogtreecommitdiff
path: root/src/port/path.c
diff options
context:
space:
mode:
authorRobert Haas <rhaas@postgresql.org>2011-07-06 11:45:13 -0400
committerRobert Haas <rhaas@postgresql.org>2011-07-06 11:45:13 -0400
commitc7f23494c1103f87bcf1ef7cbfcd626e73edb337 (patch)
tree7986492776b72dae25a10615076658879440aa03 /src/port/path.c
parent5ac6b767893281cab5c974b039400118851d548b (diff)
downloadpostgresql-c7f23494c1103f87bcf1ef7cbfcd626e73edb337.tar.gz
postgresql-c7f23494c1103f87bcf1ef7cbfcd626e73edb337.zip
Add \ir command to psql.
\ir is short for "include relative"; when used from a script, the supplied pathname will be interpreted relative to the input file, rather than to the current working directory. Gurjeet Singh, reviewed by Josh Kupershmidt, with substantial further cleanup by me.
Diffstat (limited to 'src/port/path.c')
-rw-r--r--src/port/path.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/port/path.c b/src/port/path.c
index 6991bc7247b..13ca4f3f1c1 100644
--- a/src/port/path.c
+++ b/src/port/path.c
@@ -75,6 +75,17 @@ skip_drive(const char *path)
#endif
/*
+ * has_drive_prefix
+ *
+ * Return true if the given pathname has a drive prefix.
+ */
+bool
+has_drive_prefix(const char *path)
+{
+ return skip_drive(path) != path;
+}
+
+/*
* first_dir_separator
*
* Find the location of the first directory separator, return