8
0
mirror of https://github.com/FirebirdSQL/firebird.git synced 2025-01-23 04:43:03 +01:00

Treat getenv() with more respect

This commit is contained in:
robocop 2004-09-20 08:36:34 +00:00
parent 26f2d12a5c
commit 730e020f4d

View File

@ -1113,12 +1113,12 @@ BOOLEAN API_ROUTINE isc_set_path(TEXT* file_name,
* the ISC_PATH user variable.
*
**************************************/
TEXT *pathname, *p;
/* look for the environment variables to tack
onto the beginning of the database path */
if (!(pathname = getenv("ISC_PATH")))
const TEXT* pathname = getenv("ISC_PATH");
if (!pathname)
return FALSE;
if (!file_length)
@ -1128,6 +1128,8 @@ BOOLEAN API_ROUTINE isc_set_path(TEXT* file_name,
/* if the file already contains a remote node
or any path at all forget it */
TEXT *p;
for (p = file_name; *p; p++)
if (*p == ':' || *p == '/' || *p == '\\')
return FALSE;