1
0
mirror of https://github.com/postgres/postgres.git synced 2025-06-14 18:42:34 +03:00

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.
This commit is contained in:
Robert Haas
2011-07-06 11:45:13 -04:00
parent 5ac6b76789
commit c7f23494c1
9 changed files with 68 additions and 12 deletions

View File

@ -74,6 +74,17 @@ skip_drive(const char *path)
#define skip_drive(path) (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
*