summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorAllen Byrne <byrn@hdfgroup.org>2019-07-22 22:13:56 (GMT)
committerAllen Byrne <byrn@hdfgroup.org>2019-07-22 22:13:56 (GMT)
commitb9332d6a138b6812e0729b450f993bc9bb9b22de (patch)
tree5f29f4a2f395226407167cfca9a7369e8db14169 /test
parentfbc06ff9b8e12f542814d6e5dc08c19680a5429d (diff)
downloadhdf5-b9332d6a138b6812e0729b450f993bc9bb9b22de.zip
hdf5-b9332d6a138b6812e0729b450f993bc9bb9b22de.tar.gz
hdf5-b9332d6a138b6812e0729b450f993bc9bb9b22de.tar.bz2
Correct format of drive check
Diffstat (limited to 'test')
-rw-r--r--test/links.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/test/links.c b/test/links.c
index 594e77e..b7eb6af 100644
--- a/test/links.c
+++ b/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" */