summaryrefslogtreecommitdiff
path: root/src/port/path.c
AgeCommit message (Collapse)Author
2004-08-12Add make_native_path() because Win32 COPY is an internal CMD.EXE commandBruce Momjian
and doesn't process forward slashes in the same way as external commands. Quoting the first argument to COPY does not convert forward to backward slashes, but COPY does properly process quoted forward slashes in the second argument. Win32 COPY works with quoted forward slashes in the first argument only if the current directory is the same as the directory of the first argument.
2004-08-09Path-mangling logic was failing to account for paths containing mentionsTom Lane
of '.' or '..'. Extend canonicalize_path() to trim off trailing occurrences of these things, and use it to fix up paths where needed (which I think is only after places where we trim the last path component, but maybe some others will turn up). Fixes Josh's complaint that './initdb' does not work.
2004-08-01Create a C version of pg_config.Bruce Momjian
Andrew Dunstan
2004-07-12Add blank line to new canonicalize_path file, which handles "a b\" properly.Bruce Momjian
2004-07-12Put back canonicalization of PGDATA environment variable.Bruce Momjian
2004-07-11Use canonicalize_path for -D, GUC paths, and paths coming in fromBruce Momjian
environment variables.
2004-07-11Fix trim_trailing_separator() to not trim c:\ nor \\network\ on Win32.Bruce Momjian
2004-07-10Fix BSD-only coding in port.c (passing a local variable to putenv).Tom Lane
Also a quick but half-baked attempt to make trim_trailing_separator do the right thing with path consisting only of '/' --- still needs work for Windows I think.
2004-06-11Use sizeof() rather than strlen() in array size.Bruce Momjian
2004-06-10Attached is a patch that takes care of the PATHSEP issue. I made a moreBruce Momjian
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
2004-06-08Change PGETC to PGSYSCONFDIR and PGLOCALE to PGLOCALEDIR, per Peter.Bruce Momjian
2004-06-03Add PGETC (for pg_service.conf) and PGLOCALE (for locale dir)Bruce Momjian
environment variable processing to libpq. The patch also adds code to our client apps so we set the environment variable directly based on our binary location, unless it is already set. This will allow our applications to emit proper locale messages that are generated in libpq.
2004-05-26Move setlocale() outside of NLS-only defines.Bruce Momjian
2004-05-25Allow relative paths as long as the hardcoded path matches the bin pathBruce Momjian
up to the last bin directory name.
2004-05-25Fix set_pglocale to properly pass my_exec_path to get_locale_path instead of ↵Bruce Momjian
argv0.
2004-05-25Skip settting LC_ALL in the backend.Bruce Momjian
2004-05-25Make the locale location relocatable.Bruce Momjian
Adjust get_*_path functions to be limited to MAXPGPATH.
2004-05-21Put path configuration information into a .h file instead of clutteringTom Lane
several different module Makefiles with it. Also, do any adjustment of installation paths during configure, rather than every time Makefile.global is read.
2004-05-19Win32 can't have the same function coming from two library object files,Bruce Momjian
so we make is_absolute_path a macro so libpq doesn't use path.o.
2004-05-18Clean up some relative path install issues with Claudio's help.Bruce Momjian
2004-05-17Reorganize code to allow path-relative installs.Bruce Momjian
Create new get_* functions to access compiled-in paths and adjust if relative installs are to be used. Clean up substitute_libpath_macro() code.
2004-05-12Rename find_my_binary/find_other_binary toBruce Momjian
find_my_exec/find_other_exec(). Remove passing of progname to these functions as they can find that out from argv[0], which they already have. Make get_progname return const char *, and update all progname variables to be const char *.
2004-05-11As part of the work for making relocatable installs, I have re-factoredBruce Momjian
all the code that looks for other binaries. I move FindExec into port/exec.c (and renamed it to find_my_binary()). I also added find_other_binary that looks for another binary in the same directory as the calling program, and checks the version string. The only behavior change was that initdb and pg_dump would look in the hard-coded bindir directory if it can't find the requested binary in the same directory as the caller. The new code throws an error. The old behavior seemed too error prone for version mismatches.
2004-03-09The win32 port backend will require the functionality provided byBruce Momjian
canonicalize_path. Patch moves it from initdb.c to port/path.c. Claudio Natoli
2003-11-29$Header: -> $PostgreSQL Changes ...PostgreSQL Daemon
2003-11-11Update /port C header descriptions.Bruce Momjian
2003-08-04pgindent run.Bruce Momjian
2003-04-04Add Win32 path handling for / vs. \ and drive letters.Bruce Momjian