X-Git-Url: https://git.distorted.org.uk/~mdw/termux-packages/blobdiff_plain/fef735eaee61ba7337cce5c343950d48a7909039..8f7dda8321bf7dd6ee58185c6bfd9cee4d57c987:/packages/libandroid-support/setlocale.c.patch?ds=sidebyside diff --git a/packages/libandroid-support/setlocale.c.patch b/packages/libandroid-support/setlocale.c.patch deleted file mode 100644 index e2edef3d..00000000 --- a/packages/libandroid-support/setlocale.c.patch +++ /dev/null @@ -1,35 +0,0 @@ -diff -u -r /home/fornwall/lib/android-ndk/sources/android/support/src/locale/setlocale.c ./src/locale/setlocale.c ---- /home/fornwall/lib/android-ndk/sources/android/support/src/locale/setlocale.c 2013-07-26 23:37:59.000000000 -0400 -+++ ./src/locale/setlocale.c 2015-01-01 17:16:29.488323212 -0500 -@@ -25,23 +25,18 @@ - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ --#include -+#include - #include "locale_impl.h" - - char *setlocale(int category, const char *locale) { -- // Sanity check. -- if (locale == NULL) { -- errno = EINVAL; -- return NULL; -- } -- // Only accept "", "C" or "POSIX", all equivalent on Android. -- if (*locale && strcmp(locale, "C") && strcmp(locale, "POSIX")) { -- errno = EINVAL; -- return NULL; -- } -+ // setlocale(3): "If locale is NULL, the current locale is only queried, not modified." -+ if (locale == NULL) return "en_US.UTF-8"; -+ -+ // Only accept "", "C" or "POSIX", all equivalent on Android, and any locale with UTF-8/UTF8 in it. -+ if (*locale && strcmp(locale, "C") && strcmp(locale, "POSIX") && strstr(locale, "UTF-8") == 0 && strstr(locale, "UTF8") == 0) return NULL; -+ - // The function returns a char* but the caller is not supposed to - // modify it. Just to a type cast. If the caller tries to write to - // it, it will simply segfault. -- static const char C_LOCALE_SETTING[] = "C"; -- return (char*) C_LOCALE_SETTING; -+ return "en_US.UTF-8"; - }