From b9332d6a138b6812e0729b450f993bc9bb9b22de Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Mon, 22 Jul 2019 17:13:56 -0500 Subject: Correct format of drive check --- test/links.c | 14 +++++++++----- 1 file 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: ":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: ":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" */ -- cgit v0.12