summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordudemanguy <random342@airmail.cc>2019-05-03 11:54:31 -0500
committersfan5 <sfan5@live.de>2019-05-04 14:17:40 +0200
commit037cbacb8c5081313ea65024d4305d29a47165e0 (patch)
treeae4eef2968a78f6c09346a39895dce0c7a47de6b
parentdcb7838bb7db19ae122c3d0e82fb9cebff0605ac (diff)
downloadmpv-037cbacb8c5081313ea65024d4305d29a47165e0.tar.bz2
mpv-037cbacb8c5081313ea65024d4305d29a47165e0.tar.xz
libarchive: add fallback for systems without C.UTF-8
-rw-r--r--osdep/io.h1
-rw-r--r--stream/stream_libarchive.c7
2 files changed, 6 insertions, 2 deletions
diff --git a/osdep/io.h b/osdep/io.h
index 7e8a267541..2f04337288 100644
--- a/osdep/io.h
+++ b/osdep/io.h
@@ -196,6 +196,7 @@ int msync(void *addr, size_t length, int flags);
// These are stubs since there is not anything that helps with this on Windows.
#define locale_t int
#define LC_ALL_MASK 0
+#define LC_CTYPE_MASK 0
locale_t newlocale(int, const char *, locale_t);
locale_t uselocale(locale_t);
void freelocale(locale_t);
diff --git a/stream/stream_libarchive.c b/stream/stream_libarchive.c
index e5acad016b..ae06efb890 100644
--- a/stream/stream_libarchive.c
+++ b/stream/stream_libarchive.c
@@ -244,8 +244,11 @@ struct mp_archive *mp_archive_new(struct mp_log *log, struct stream *src,
struct mp_archive *mpa = talloc_zero(NULL, struct mp_archive);
mpa->log = log;
mpa->locale = newlocale(LC_ALL_MASK, "C.UTF-8", (locale_t)0);
- if (!mpa->locale)
- goto err;
+ if (!mpa->locale) {
+ mpa->locale = newlocale(LC_CTYPE_MASK, "", (locale_t)0);
+ if (!mpa->locale)
+ goto err;
+ }
mpa->arch = archive_read_new();
mpa->primary_src = src;
if (!mpa->arch)