From fbfa3426e2818264847f5f7046cb078c96021037 Mon Sep 17 00:00:00 2001 From: Klaas Freitag Date: Wed, 12 Jun 2013 15:50:16 +0200 Subject: [PATCH] tests: Fix multibyte stat(). --- tests/std_tests/check_std_c_file.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tests/std_tests/check_std_c_file.c b/tests/std_tests/check_std_c_file.c index 46ea7c419..41a0ff40f 100644 --- a/tests/std_tests/check_std_c_file.c +++ b/tests/std_tests/check_std_c_file.c @@ -8,6 +8,7 @@ #include "std/c_private.h" #include "std/c_file.h" +#include "std/c_string.h" const char *check_dir = "/tmp/check"; const char *check_src_file = "/tmp/check/foo.txt"; @@ -15,7 +16,11 @@ const char *check_dst_file = "/tmp/check/bar.txt"; static int test_file(const char *path, mode_t mode) { csync_stat_t sb; - if (_tstat(path, &sb) < 0) { + mbchar_t *mbpath = c_utf8_to_locale(path); + int rc = _tstat(mbpath, &sb); + c_free_locale_string(mbpath); + + if (rc < 0) { return -1; }