mirror of
https://github.com/owntone/owntone-server.git
synced 2024-12-25 06:35:57 -05:00
Fix windows open for non-latin files
This commit is contained in:
parent
d88132f6c9
commit
1ca5cef013
@ -195,7 +195,6 @@ case $host in
|
||||
AM_CONDITIONAL(COND_REND_POSIX,false);;
|
||||
esac
|
||||
|
||||
|
||||
dnl Checks for libraries.
|
||||
AC_ARG_WITH(static-libs,
|
||||
[--with-static-libs[[=DIR]] use static libs in DIR],[
|
||||
@ -330,6 +329,9 @@ else
|
||||
fi
|
||||
CFLAGS=$oldcflags
|
||||
|
||||
AC_CHECK_LIB(iconv,libiconv,,
|
||||
AC_CHECK_LIB(iconv,iconv,,echo "Must have iconv"; exit))
|
||||
|
||||
if test x$use_gdbm = xtrue; then
|
||||
AC_CHECK_HEADERS(gdbm.h,, [
|
||||
AC_MSG_ERROR([gdbm.h not found... Must have gdbm headers installed])])
|
||||
|
8
src/io.c
8
src/io.c
@ -1349,7 +1349,7 @@ int io_file_open(IO_PRIVHANDLE *phandle, char *uri) {
|
||||
uint32_t native_mode=0;
|
||||
#ifdef WIN32
|
||||
uint32_t native_permissions=0;
|
||||
WCHAR utf16_path[PATH_MAX+1]; /* the real windows utf16 path */
|
||||
WCHAR *utf16_path; /* the real windows utf16 path */
|
||||
#endif
|
||||
|
||||
ASSERT(phandle);
|
||||
@ -1394,8 +1394,10 @@ int io_file_open(IO_PRIVHANDLE *phandle, char *uri) {
|
||||
else
|
||||
native_mode |= OPEN_EXISTING;
|
||||
|
||||
priv->fd = CreateFile(uri,native_permissions,FILE_SHARE_READ,NULL,
|
||||
native_mode,FILE_ATTRIBUTE_NORMAL,NULL);
|
||||
utf16_path = (WCHAR *)util_utf8toutf16_alloc(uri);
|
||||
priv->fd = CreateFileW(utf16_path,native_permissions,FILE_SHARE_READ,NULL,
|
||||
native_mode,FILE_ATTRIBUTE_NORMAL,NULL);
|
||||
free(utf16_path);
|
||||
if(priv->fd == INVALID_HANDLE_VALUE) {
|
||||
io_file_seterr(phandle,IO_E_FILE_OTHER);
|
||||
return FALSE;
|
||||
|
Loading…
Reference in New Issue
Block a user