summaryrefslogtreecommitdiff
path: root/src/port/path.c
AgeCommit message (Collapse)Author
2009-04-03Use (unsigned char) cast in argument of pg_tolower(). Maybe it works onTom Lane
Windows without that, but we shouldn't put bad examples where people might copy them. Also, reformat slightly to improve the odds that pgindent won't go nuts on this.
2009-04-03Make directory name comparisons on Win32 case insensitive.Magnus Hagander
This method will not catch all different ways since the locale handling in NTFS doesn't provide an easy way to do that, but it will hopefully solve the most common cases causing startup problems when the backend is found in the system PATH. Attempts to fix bug #4694.
2009-01-01Update copyright for 2009.Bruce Momjian
2008-02-18Added --htmldir option to pg_config, equivalent to the new configure option.Peter Eisentraut
2008-01-01Update copyrights in source tree to 2008.Bruce Momjian
2007-11-15pgindent run for 8.3.Bruce Momjian
2007-10-23Use snprintf instead of wsprintf, and use getenv("APPDATA") instead ofMagnus Hagander
SHGetFolderPath. This removes the direct dependency on shell32.dll and user32.dll, which eats a lot of "desktop heap" for each backend that's started. The desktop heap is a very limited resource, causing backends to no longer start once it's been exhausted. We still have indirect depdendencies on user32.dll through third party libraries, but those can't easily be removed. Dave Page
2007-01-05Update CVS HEAD for 2007 copyright. Back branches are typically notBruce Momjian
back-stamped for this.
2006-10-04pgindent run for 8.2.Bruce Momjian
2006-09-27Replace strncpy with strlcpy in selected places that seem possibly relevantTom Lane
to performance. (A wholesale effort to get rid of strncpy should be undertaken sometime, but not during beta.) This commit also fixes dynahash.c to correctly truncate overlength string keys for hashtables, so that its callers don't have to anymore.
2006-09-22Fix bugs in plpgsql and ecpg caused by assuming that isspace() would onlyTom Lane
return true for exactly the characters treated as whitespace by their flex scanners. Per report from Victor Snezhko and subsequent investigation. Also fix a passel of unsafe usages of <ctype.h> functions, that is, ye olde char-vs-unsigned-char issue. I won't miss <ctype.h> when we are finally able to stop using it.
2006-09-11Move set_pglocale_pgservice() from path.c to exec.c, so that pulling inTom Lane
path.c does not in itself force linking of both exec.c and libintl. Should fix current ecpglib build failure on pickier platforms.
2006-03-05Update copyright for 2006. Update scripts.Bruce Momjian
2006-02-01Fix const cast in get_progname().Bruce Momjian
Backpatch.
2006-02-01Set progname early in the postmaster/postgres binary, rather than doingBruce Momjian
it later. This fixes a problem where EXEC_BACKEND didn't have progname set, causing a segfault if log_min_messages was set below debug2 and our own snprintf.c was being used. Also alway strdup() progname. Backpatch to 8.1.X and 8.0.X.
2005-12-23Fix make_relative_path() to support cases where target_path and bin_pathTom Lane
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.
2005-11-22Re-run pgindent, fixing a problem where comment lines after a blankBruce Momjian
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.
2005-10-15Standard pgindent run for 8.1.Bruce Momjian
2005-10-13Use get_progname() in backend main.c, rather than port-specific hackBruce Momjian
that is too fragile.
2005-09-27Fix problems with PGXS builds against an installation tree that wasTom Lane
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.
2005-08-29Fix platform-specific test for path prefix-ness: move it into path.c whereTom Lane
it can be done right. Allow explicit use of absolute DataDir path. Per Dave Page.
2005-08-12Fix up canonicalize_path to do the right thing in all cases (I think ...Tom Lane
this was harder than it seemed at first glance). Also push code for checking for ".." in file names into path.c where it belongs.
2005-08-12Reverse out changes to canonicalize_path(), per suggestion from Tom.Bruce Momjian
2005-08-12Modify canonicalize_path() so if we would return a trailing "..", throwBruce Momjian
an error instead.
2005-08-12Update comments.Bruce Momjian
2005-08-12Document why we only handle trailing "..".Bruce Momjian
2005-08-11Fix canonicalize_path so "../.." isn't stripped off and ignored.Bruce Momjian
2005-01-26Use SHGetFolderPath instead of SHGetSpecialFolderPath to find theTom Lane
APPDATA directory on Windows. Magnus Hagander
2005-01-10Un-break MSVC build, per Andrew Dunstan.Tom Lane
2005-01-06Minor mop-up for Windows home-directory stuff, per Magnus.Tom Lane
2005-01-06Adjust lookup of client-side profile files (.pgpass and so on) as perTom Lane
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.
2005-01-06Make the various places that determine the user's "home directory"Tom Lane
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.
2004-12-31Tag appropriate files for rc3PostgreSQL Daemon
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 ...
2004-11-07Removes duplicate slashes from the path in canonicalize_path(). ItBruce Momjian
preserve double leading slashes on Win32. e.g. ////a////b => /a/b
2004-11-06Simplify relative-path logic, on the assumption that compiled-in pathsTom Lane
won't have trivial differences in their common prefix.
2004-11-06Fix sizeof(EXE) arithmetic, per Andrew Dunstan.Tom Lane
2004-11-06Code cleanup in path.c and exec.c. Handle Windows drive and network specsTom Lane
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.
2004-11-02Add comment about memory failure of get_progname exiting the postmaster:Bruce Momjian
exit(1); /* This could exit the postmaster */
2004-11-01Adjust use of sizeof(EXE).Bruce Momjian
2004-11-01Clarify coding of .exe patchBruce Momjian
2004-10-27Canonicalize Win32 path coming in from pg_ctl -D, idea from Magnus.Bruce Momjian
2004-10-24On Windows, cause get_progname to strip any .EXE suffix.Tom Lane
Andrew Dunstan
2004-09-24Fix gratuitous weirdness in function prototype, per Kris Jurka.Tom Lane
2004-09-02Remove useless variable.Tom Lane
2004-08-29Add WAL logging for CREATE/DROP DATABASE and CREATE/DROP TABLESPACE.Tom Lane
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.
2004-08-29Pgindent run for 8.0.Bruce Momjian
2004-08-29Update copyright to 2004.Bruce Momjian
2004-08-18Add get_home_path() to use USERPROFILE on Win32 and HOME on Unix.Bruce Momjian
2004-08-13Fix core dumps, inability to count, etc associated with canonicalize_pathTom Lane
patches.
2004-08-12Cleanup Win32 COPY handling, and move archive examples to SGML.Bruce Momjian