summaryrefslogtreecommitdiff
path: root/Build/source/texk/xdvik/tests/test_string_utils.c
diff options
context:
space:
mode:
Diffstat (limited to 'Build/source/texk/xdvik/tests/test_string_utils.c')
-rw-r--r--Build/source/texk/xdvik/tests/test_string_utils.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/Build/source/texk/xdvik/tests/test_string_utils.c b/Build/source/texk/xdvik/tests/test_string_utils.c
index 086d54dad13..b3cb9a70cf4 100644
--- a/Build/source/texk/xdvik/tests/test_string_utils.c
+++ b/Build/source/texk/xdvik/tests/test_string_utils.c
@@ -321,8 +321,13 @@ static Boolean test_expand_filename(int verbose)
globals.dvi_file.dirname = xstrcat(globals.dvi_file.dirname, "/");
testpath2 = expand_filename(__FILE__, USE_DVI_PATH);
- currpath = xstrcat(currpath, "/");
- currpath = xstrcat(currpath, __FILE__);
+ if (__FILE__[0] == '/') {
+ free(currpath);
+ currpath = xstrdup(__FILE__);
+ } else {
+ currpath = xstrcat(currpath, "/");
+ currpath = xstrcat(currpath, __FILE__);
+ }
return test_str_equality(verbose, testpath1, currpath) \
&& test_str_equality(verbose, testpath2, currpath);