mirror of
https://github.com/HDFGroup/hdf5.git
synced 2024-11-21 01:04:10 +08:00
[svn-r14822] 1. src/H5private.h: fixed a bug in CHECK_ABSOLUTE() for windows.
2. test/links.c: fixed one external link test to be the same as in 1.8.
This commit is contained in:
parent
ae63d4bf4f
commit
0f7c9bcd5e
@ -927,7 +927,7 @@ extern char *strdup(const char *s);
|
||||
#define DIR_SEPC '\\'
|
||||
#define DIR_SEPS "\\"
|
||||
#define CHECK_DELIMITER(SS) ((SS == DIR_SEPC)||(SS == DIR_SLASH_SEPC))
|
||||
#define CHECK_ABSOLUTE(NAME) (((isalpha(NAME[0])) && (NAME[1] == ':') && CHECK_DELIMITER(NAME[2]))
|
||||
#define CHECK_ABSOLUTE(NAME) ((isalpha(NAME[0])) && (NAME[1] == ':') && (CHECK_DELIMITER(NAME[2])))
|
||||
#define CHECK_ABS_DRIVE(NAME) ((isalpha(NAME[0])) && (NAME[1] == ':'))
|
||||
#define CHECK_ABS_PATH(NAME) (CHECK_DELIMITER(NAME[0]))
|
||||
|
||||
@ -941,7 +941,6 @@ extern char *strdup(const char *s);
|
||||
(ptr = slash); \
|
||||
}
|
||||
|
||||
|
||||
#else
|
||||
|
||||
#define DIR_SEPC '/'
|
||||
|
17
test/links.c
17
test/links.c
@ -2603,10 +2603,10 @@ external_link_env(hid_t fapl, hbool_t new_format)
|
||||
{
|
||||
hid_t fid = (-1); /* File ID */
|
||||
hid_t gid = (-1); /* Group IDs */
|
||||
|
||||
char *envval=NULL;
|
||||
static char *new_env = "HDF5_EXT_PREFIX=.:tmp";
|
||||
static char *env_var = "HDF5_EXT_PREFIX";
|
||||
static envstring[NAME_BUF_SIZE];
|
||||
static char *old_env = "HDF5_EXT_PREFIX=";
|
||||
|
||||
char filename1[NAME_BUF_SIZE],
|
||||
filename2[NAME_BUF_SIZE],
|
||||
@ -2644,24 +2644,17 @@ external_link_env(hid_t fapl, hbool_t new_format)
|
||||
/* Create external link to target file */
|
||||
if(H5Lcreate_external(filename2, "/A", fid, "ext_link", H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR
|
||||
|
||||
/* get original value for the HDF library environment variable for external link if set */
|
||||
envval = HDgetenv(env_var);
|
||||
if (HDputenv(new_env) < 0)
|
||||
TEST_ERROR
|
||||
|
||||
|
||||
/* Open object through external link */
|
||||
H5E_BEGIN_TRY {
|
||||
gid = H5Gopen2(fid, "ext_link", H5P_DEFAULT);
|
||||
} H5E_END_TRY;
|
||||
|
||||
/* restore value for the environment variable as needed */
|
||||
if ((envval != NULL) && (*envval)) {
|
||||
sprintf(envstring, "%s=%s", env_var, envval);
|
||||
if (HDputenv(envstring) < 0)
|
||||
TEST_ERROR
|
||||
}
|
||||
|
||||
if (HDputenv(old_env) < 0)
|
||||
TEST_ERROR
|
||||
|
||||
/* should be able to find the target file from pathnames set via environment variable */
|
||||
if (gid < 0) {
|
||||
H5_FAILED();
|
||||
|
Loading…
Reference in New Issue
Block a user