aboutsummaryrefslogtreecommitdiff
path: root/src/port/path.c
Commit message (Collapse)AuthorAge
...
* Fix make_relative_path() to support cases where target_path and bin_pathTom Lane2005-12-23
| | | | | | | | | | | differ by more than the last directory component. Instead of insisting that they match up to the last component, accept whatever common prefix they have, and try to replace the non-matching part of bin_path with the non-matching part of target_path in the actual executable's path. In one way this is tighter than the old code, because it insists on a match to the part of bin_path we want to substitute for, rather than blindly stripping one directory component from the executable's path. Per gripe from Martin Pitt and subsequent discussion.
* Re-run pgindent, fixing a problem where comment lines after a blankBruce Momjian2005-11-22
| | | | | | | | | comment line where output as too long, and update typedefs for /lib directory. Also fix case where identifiers were used as variable names in the backend, but as typedefs in ecpg (favor the backend for indenting). Backpatch to 8.1.X.
* Standard pgindent run for 8.1.Bruce Momjian2005-10-15
|
* Use get_progname() in backend main.c, rather than port-specific hackBruce Momjian2005-10-13
| | | | that is too fragile.
* Fix problems with PGXS builds against an installation tree that wasTom Lane2005-09-27
| | | | | | | relocated after installation. We can't trust the installation paths inserted into Makefile.global by configure, so instead we must get the paths from pg_config. This requires extending pg_config to support all the separately-configurable path names, but that was on TODO anyway.
* Fix platform-specific test for path prefix-ness: move it into path.c whereTom Lane2005-08-29
| | | | | it can be done right. Allow explicit use of absolute DataDir path. Per Dave Page.
* Fix up canonicalize_path to do the right thing in all cases (I think ...Tom Lane2005-08-12
| | | | | this was harder than it seemed at first glance). Also push code for checking for ".." in file names into path.c where it belongs.
* Reverse out changes to canonicalize_path(), per suggestion from Tom.Bruce Momjian2005-08-12
|
* Modify canonicalize_path() so if we would return a trailing "..", throwBruce Momjian2005-08-12
| | | | an error instead.
* Update comments.Bruce Momjian2005-08-12
|
* Document why we only handle trailing "..".Bruce Momjian2005-08-12
|
* Fix canonicalize_path so "../.." isn't stripped off and ignored.Bruce Momjian2005-08-11
|
* Use SHGetFolderPath instead of SHGetSpecialFolderPath to find theTom Lane2005-01-26
| | | | APPDATA directory on Windows. Magnus Hagander
* Un-break MSVC build, per Andrew Dunstan.Tom Lane2005-01-10
|
* Minor mop-up for Windows home-directory stuff, per Magnus.Tom Lane2005-01-06
|
* Adjust lookup of client-side profile files (.pgpass and so on) as perTom Lane2005-01-06
| | | | | | discussion on pgsql-hackers-win32 list. Documentation still needs to be tweaked --- I'm not sure how to refer to the APPDATA folder in user documentation.
* Make the various places that determine the user's "home directory"Tom Lane2005-01-06
| | | | | | | | consistent. On Unix we now always consult getpwuid(); $HOME isn't used at all. On Windows the code currently consults $USERPROFILE, or $HOME if that's not defined, but I expect this will change as soon as the win32 hackers come to a consensus. Nothing done yet about changing the file names used underneath $USERPROFILE.
* Tag appropriate files for rc3PostgreSQL Daemon2004-12-31
| | | | | | | | Also performed an initial run through of upgrading our Copyright date to extend to 2005 ... first run here was very simple ... change everything where: grep 1996-2004 && the word 'Copyright' ... scanned through the generated list with 'less' first, and after, to make sure that I only picked up the right entries ...
* Removes duplicate slashes from the path in canonicalize_path(). ItBruce Momjian2004-11-07
| | | | | | preserve double leading slashes on Win32. e.g. ////a////b => /a/b
* Simplify relative-path logic, on the assumption that compiled-in pathsTom Lane2004-11-06
| | | | won't have trivial differences in their common prefix.
* Fix sizeof(EXE) arithmetic, per Andrew Dunstan.Tom Lane2004-11-06
|
* Code cleanup in path.c and exec.c. Handle Windows drive and network specsTom Lane2004-11-06
| | | | | | everywhere not just some places, get rid of . and .. when joining path sections together. This should eliminate most of the ugly paths like /foo/bar/./baz that we've been generating.
* Add comment about memory failure of get_progname exiting the postmaster:Bruce Momjian2004-11-02
| | | | exit(1); /* This could exit the postmaster */
* Adjust use of sizeof(EXE).Bruce Momjian2004-11-01
|
* Clarify coding of .exe patchBruce Momjian2004-11-01
|
* Canonicalize Win32 path coming in from pg_ctl -D, idea from Magnus.Bruce Momjian2004-10-27
|
* On Windows, cause get_progname to strip any .EXE suffix.Tom Lane2004-10-24
| | | | Andrew Dunstan
* Fix gratuitous weirdness in function prototype, per Kris Jurka.Tom Lane2004-09-24
|
* Remove useless variable.Tom Lane2004-09-02
|
* Add WAL logging for CREATE/DROP DATABASE and CREATE/DROP TABLESPACE.Tom Lane2004-08-29
| | | | | | | | Fix TablespaceCreateDbspace() to be able to create a dummy directory in place of a dropped tablespace's symlink. This eliminates the open problem of a PANIC during WAL replay when a replayed action attempts to touch a file in a since-deleted tablespace. It also makes for a significant improvement in the usability of PITR replay.
* Pgindent run for 8.0.Bruce Momjian2004-08-29
|
* Update copyright to 2004.Bruce Momjian2004-08-29
|
* Add get_home_path() to use USERPROFILE on Win32 and HOME on Unix.Bruce Momjian2004-08-18
|
* Fix core dumps, inability to count, etc associated with canonicalize_pathTom Lane2004-08-13
| | | | patches.
* Cleanup Win32 COPY handling, and move archive examples to SGML.Bruce Momjian2004-08-12
|
* Add make_native_path() because Win32 COPY is an internal CMD.EXE commandBruce Momjian2004-08-12
| | | | | | | | | | 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.
* Path-mangling logic was failing to account for paths containing mentionsTom Lane2004-08-09
| | | | | | | | 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.
* Create a C version of pg_config.Bruce Momjian2004-08-01
| | | | Andrew Dunstan
* Add blank line to new canonicalize_path file, which handles "a b\" properly.Bruce Momjian2004-07-12
|
* Put back canonicalization of PGDATA environment variable.Bruce Momjian2004-07-12
|
* Use canonicalize_path for -D, GUC paths, and paths coming in fromBruce Momjian2004-07-11
| | | | environment variables.
* Fix trim_trailing_separator() to not trim c:\ nor \\network\ on Win32.Bruce Momjian2004-07-11
|
* Fix BSD-only coding in port.c (passing a local variable to putenv).Tom Lane2004-07-10
| | | | | | 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.
* Use sizeof() rather than strlen() in array size.Bruce Momjian2004-06-11
|
* Attached is a patch that takes care of the PATHSEP issue. I made a moreBruce Momjian2004-06-10
| | | | | | | | | | | | | | | | | | | 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
* Change PGETC to PGSYSCONFDIR and PGLOCALE to PGLOCALEDIR, per Peter.Bruce Momjian2004-06-08
|
* Add PGETC (for pg_service.conf) and PGLOCALE (for locale dir)Bruce Momjian2004-06-03
| | | | | | | | | 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.
* Move setlocale() outside of NLS-only defines.Bruce Momjian2004-05-26
|
* Allow relative paths as long as the hardcoded path matches the bin pathBruce Momjian2004-05-25
| | | | up to the last bin directory name.
* Fix set_pglocale to properly pass my_exec_path to get_locale_path instead of ↵Bruce Momjian2004-05-25
| | | | argv0.