diff options
author | Daniel Caujolle-Bert <f1rmb@users.sourceforge.net> | 2006-02-02 22:35:30 +0000 |
---|---|---|
committer | Daniel Caujolle-Bert <f1rmb@users.sourceforge.net> | 2006-02-02 22:35:30 +0000 |
commit | 14aacb74ae0888d271ed1e67a6df557f14842927 (patch) | |
tree | 1a29876d612df895896db05a61f0b0ce7aaa0d09 /src | |
parent | d19164dd9ef4540c331ea552fc767f96c6591f1a (diff) | |
download | xine-lib-14aacb74ae0888d271ed1e67a6df557f14842927.tar.gz xine-lib-14aacb74ae0888d271ed1e67a6df557f14842927.tar.bz2 |
libsmbclient seems messing up intl'. Adding locale save/restore workaround.
CVS patchset: 7863
CVS date: 2006/02/02 22:35:30
Diffstat (limited to 'src')
-rw-r--r-- | src/input/input_smb.c | 23 |
1 files changed, 19 insertions, 4 deletions
diff --git a/src/input/input_smb.c b/src/input/input_smb.c index 20ad5cf79..0ecc6dfba 100644 --- a/src/input/input_smb.c +++ b/src/input/input_smb.c @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * - * $Id: input_smb.c,v 1.5 2005/10/14 21:02:16 miguelfreitas Exp $ + * $Id: input_smb.c,v 1.6 2006/02/02 22:35:30 f1rmb Exp $ */ @@ -34,6 +34,10 @@ #include <sys/types.h> #include <errno.h> +#ifdef HAVE_SETLOCALE +#include <locale.h> +#endif + typedef struct { input_class_t input_class; xine_t *xine; @@ -234,11 +238,15 @@ void smb_auth(const char *srv, const char *shr, char *wg, int wglen, char *un, i static void *init_input_class (xine_t *xine, void *data) { - smb_input_class_t *this; + smb_input_class_t *this = NULL; + /* libsmbclient seems to mess up with locale. Workaround: save and restore locale */ +#ifdef HAVE_SETLOCALE + char *lcl = strdup(setlocale(LC_MESSAGES, NULL)); +#endif if (smbc_init(smb_auth,(xine->verbosity >= XINE_VERBOSITY_DEBUG))) - return NULL; - + goto _exit_error; + this = (smb_input_class_t *) xine_xmalloc(sizeof(smb_input_class_t)); this->xine = xine; @@ -250,6 +258,13 @@ static void this->input_class.dispose = smb_class_dispose; this->input_class.eject_media = NULL; + _exit_error: + +#ifdef HAVE_SETLOCALE + setlocale(LC_MESSAGES, lcl); + free(lcl); +#endif + return (input_class_t *) this; } |