libxbps: initialize locale correctly to handle UTF-8 filenames with musl.

This fixes unpacking of ca-certificates that wasn't unpacking the files
with UTF-8 characters correctly.
This commit is contained in:
Juan RP 2015-12-11 09:59:16 +01:00
parent 2830bbef6d
commit 9c4fa4909c
2 changed files with 6 additions and 0 deletions

3
NEWS
View File

@ -1,5 +1,8 @@
xbps-0.51 (???): xbps-0.51 (???):
* libxbps: initialize locale correctly to handle UTF-8 filenames correctly
in binary packages with the musl C library.
* alternatives: preserve current order while updating packages. * alternatives: preserve current order while updating packages.
* alternatives: always create the directory where the symlink is stored, * alternatives: always create the directory where the symlink is stored,

View File

@ -31,6 +31,7 @@
#include <ctype.h> #include <ctype.h>
#include <unistd.h> #include <unistd.h>
#include <limits.h> #include <limits.h>
#include <locale.h>
#include "xbps_api_impl.h" #include "xbps_api_impl.h"
@ -211,6 +212,8 @@ xbps_transaction_commit(struct xbps_handle *xhp)
int rv = 0; int rv = 0;
bool update; bool update;
setlocale(LC_ALL, "");
assert(xbps_object_type(xhp->transd) == XBPS_TYPE_DICTIONARY); assert(xbps_object_type(xhp->transd) == XBPS_TYPE_DICTIONARY);
/* /*
* Create cachedir if necessary. * Create cachedir if necessary.