From 5370f52b1564f3801639f2bb3fc25f4583c4a565 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Axel=20D=C3=B6rfler?= Date: Thu, 2 Mar 2006 18:34:13 +0000 Subject: [PATCH] setlocale() now returns "C" in case the locale is set to NULL. This allows current VLC to run without the need of exporting one of the LC_ALL/LC_CTYPE/LANG environment variables (it used to crash without this). git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@16571 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/system/libroot/posix/locale/setlocale.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/system/libroot/posix/locale/setlocale.c b/src/system/libroot/posix/locale/setlocale.c index 4dea430f1e..1717421bba 100644 --- a/src/system/libroot/posix/locale/setlocale.c +++ b/src/system/libroot/posix/locale/setlocale.c @@ -1,7 +1,7 @@ /* -** Copyright 2004, Axel Dörfler, axeld@pinc-software.de. All rights reserved. -** Distributed under the terms of the Haiku License. -*/ + * Copyright 2004-2006, Axel Dörfler, axeld@pinc-software.de. All rights reserved. + * Distributed under the terms of the MIT License. + */ #include @@ -11,6 +11,9 @@ char * setlocale(int category, const char *locale) { + if (locale == NULL) + return "C"; + // ToDo: this should check if liblocale.so is available and use its functions return NULL; }