mirror of
https://github.com/HDFGroup/hdf5.git
synced 2024-11-21 01:04:10 +08:00
Correct format of drive check
This commit is contained in:
parent
fbc06ff9b8
commit
b9332d6a13
14
test/links.c
14
test/links.c
@ -4805,6 +4805,10 @@ external_link_win5(hid_t fapl, hbool_t new_format)
|
||||
if(NULL == HDgetcwd(cwdpath, (size_t)NAME_BUF_SIZE))
|
||||
TEST_ERROR
|
||||
drive = HDgetdrive();
|
||||
if (drive >= 26)
|
||||
drive -= 1; /* account for drive Z */
|
||||
else
|
||||
drive += 1;
|
||||
|
||||
/* set up name for main file: "/CWD/extlinks0" */
|
||||
HDstrcpy(tmpname, &cwdpath[2]); /* stripped the drive letter to make it rel drive but absolute path */
|
||||
@ -4813,9 +4817,7 @@ external_link_win5(hid_t fapl, hbool_t new_format)
|
||||
h5_fixname(tmpname, fapl, filename1, sizeof filename1);
|
||||
|
||||
/* set up name for target link: "<drive-letter+1>:tmp/extlinks14" */
|
||||
if (drive >= 26)
|
||||
drive -= 2; /* account for drive Z */
|
||||
HDsnprintf(tmpname, sizeof(tmpname), "%c:%s", ((drive+1)+'A'-1), FILENAME[35]);
|
||||
HDsnprintf(tmpname, sizeof(tmpname), "%c:%s", (drive+'A'-1), FILENAME[35]);
|
||||
h5_fixname(tmpname, fapl, filename2, sizeof filename2);
|
||||
|
||||
/* set up name for target file: "tmp/extlinks14" */
|
||||
@ -4904,13 +4906,15 @@ external_link_win6(hid_t fapl, hbool_t new_format)
|
||||
TEST_ERROR
|
||||
drive = HDgetdrive();
|
||||
if (drive >= 26)
|
||||
drive -= 2; /* account for drive Z */
|
||||
drive -= 1; /* account for drive Z */
|
||||
else
|
||||
drive += 1;
|
||||
|
||||
/* set up name for main file: "extlinks0" */
|
||||
h5_fixname(FILENAME[12], fapl, filename1, sizeof filename1);
|
||||
|
||||
/* set up name for target link: "<drive-letter+1>:tmp/extlinks15" */
|
||||
HDsnprintf(tmpname, sizeof(tmpname), "%c:%s", ((drive+1)+'A'-1), FILENAME[36]);
|
||||
HDsnprintf(tmpname, sizeof(tmpname), "%c:%s", (drive+'A'-1), FILENAME[36]);
|
||||
h5_fixname(tmpname, fapl, filename2, sizeof filename2);
|
||||
|
||||
/* set up name for target file: "tmp/extlinks15" */
|
||||
|
Loading…
Reference in New Issue
Block a user