[gnutls-devel] GnuTLS | Re-introduce topendir on Windows with Unicode support (!932)
Development of GNU's TLS library
gnutls-devel at lists.gnutls.org
Thu Feb 21 14:41:58 CET 2019
Hugo Beauzée-Luyssen commented on a discussion on lib/x509/verify-high2.c:
> + gnutls_datum_t utf16 = {NULL, 0};
> +
> + r = _gnutls_utf8_to_ucs2(dirname, strlen(dirname), &utf16);
> + if (r < 0)
> + return gnutls_assert_val(r);
> + dirp = _topendir((_TCHAR*)utf16.data);
> + gnutls_free(utf16.data);
> + if (dirp != NULL) {
> + do {
> + d = _treaddir(dirp);
> + if (d != NULL
> +#ifdef _DIRENT_HAVE_D_TYPE
> + && (d->d_type == DT_REG || d->d_type == DT_LNK || d->d_type == DT_UNKNOWN)
> +#endif
> + ) {
> + snprintf(path, sizeof(path), "%s/%S",
My bad, I thought %S was covered by the standard, but it seems it's not.
Regarding the 2nd part of your question, my understanding is that they are converted indeed
```
If an l length modifier is present, the argument shall be a pointer to the initial
element of an array of wchar_t type. Wide characters from the array are
converted to multibyte characters
```
N1548 - §7.21.6.1
I'll make the change locally and will check with the testsuite
--
Reply to this email directly or view it on GitLab: https://gitlab.com/gnutls/gnutls/merge_requests/932#note_143647305
You're receiving this email because of your account on gitlab.com.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.gnupg.org/pipermail/gnutls-devel/attachments/20190221/4d3cd129/attachment.html>
More information about the Gnutls-devel
mailing list