comparison input/input.c @ 14542:4a6b79a1ad52

remove all setlocale calls, they break the behaviour of sscanf and strcasecmp, especially with tr_TR locale - and do not seem to be good for anything.
author reimar
date Thu, 20 Jan 2005 13:22:53 +0000
parents 000250ff9516
children f6d4ef286a6b
comparison
equal deleted inserted replaced
14541:bef9d6dc2333 14542:4a6b79a1ad52
9 #include <sys/types.h> 9 #include <sys/types.h>
10 #include <sys/stat.h> 10 #include <sys/stat.h>
11 #include <sys/time.h> 11 #include <sys/time.h>
12 #include <fcntl.h> 12 #include <fcntl.h>
13 #include <ctype.h> 13 #include <ctype.h>
14
15 #ifdef USE_SETLOCALE
16 #include <locale.h>
17 #endif
18 14
19 #include "input.h" 15 #include "input.h"
20 #include "mouse.h" 16 #include "mouse.h"
21 #ifdef MP_DEBUG 17 #ifdef MP_DEBUG
22 #include <assert.h> 18 #include <assert.h>
597 ptr = NULL; 593 ptr = NULL;
598 } 594 }
599 break; 595 break;
600 case MP_CMD_ARG_FLOAT: 596 case MP_CMD_ARG_FLOAT:
601 errno = 0; 597 errno = 0;
602 /* <olo@altkom.com.pl> Use portable C locale for parsing floats: */
603 #ifdef USE_SETLOCALE
604 setlocale(LC_NUMERIC, "C");
605 #endif
606 cmd->args[i].v.f = atof(ptr); 598 cmd->args[i].v.f = atof(ptr);
607 #ifdef USE_SETLOCALE
608 setlocale(LC_NUMERIC, "");
609 #endif
610 if(errno != 0) { 599 if(errno != 0) {
611 mp_msg(MSGT_INPUT,MSGL_ERR,"Command %s: argument %d isn't a float.\n",cmd_def->name,i+1); 600 mp_msg(MSGT_INPUT,MSGL_ERR,"Command %s: argument %d isn't a float.\n",cmd_def->name,i+1);
612 ptr = NULL; 601 ptr = NULL;
613 } 602 }
614 break; 603 break;