Re: [BUGS] More SSL questions..

"Andrew Dunstan" <[email protected]>
Newsgroups gmane.comp.db.postgresql.devel.win32
Message-ID <[email protected]>
Magnus Hagander said:

> So, a quick implementation (not tested, but shouldn't be too hard) of
> your functino would be:
> static bool pqGetHomeDirectory(char *buf, int bufsize)
> {
> 	char tmppath[MAX_PATH+16]; /* Add 16 chars for "/.postgresql/"
> */
> 	ZeroMemory(tmppath,sizeof(tmppath));
> 	if (!SHGetSpecialFolderPath(NULL, tmppath, CSIDL_APPDATA,
> FALSE)) {
> 		return FALSE;
> 	strcat(tmppath,"/.postgresql/");
> 	if (strlen(tmppath) > bufsize)
> 		return FALSE; /* Better than returning a chopped-off
> path */
> 	strcpy(buf, tmppath);
> 	return TRUE;
> }
>
> You're going to have to add #include <shlobj.h> to the file as well.
>


Excellent. I would suggest that we allow an environment variable PGHOME to
override this on all platforms, falling back to the above on Windows and
HOME elsewhere.

cheers

andrew



---------------------------(end of broadcast)---------------------------
TIP 6: Have you searched our list archives?

               http://archives.postgresql.org
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.