aboutsummaryrefslogtreecommitdiffhomepage
path: root/Gui
diff options
context:
space:
mode:
authorGravatar pontscho <pontscho@b3059339-0415-0410-9bf9-f77b7e298cf2>2002-09-05 15:22:45 +0000
committerGravatar pontscho <pontscho@b3059339-0415-0410-9bf9-f77b7e298cf2>2002-09-05 15:22:45 +0000
commitaa7224916eecf5b3c389fe24d912d4d5b4d70810 (patch)
tree80bfe4023aecf6119d9abbad185d47f370e890e5 /Gui
parenta66a4b1b516f957b6441cff397989194addf9076 (diff)
- add fuckin locale fix from Dietrich Clauß <dc2@clauss.dyndns.org>
(Yeah. Nice round:) git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@7284 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'Gui')
-rw-r--r--Gui/cfg.c36
1 files changed, 15 insertions, 21 deletions
diff --git a/Gui/cfg.c b/Gui/cfg.c
index 22c4f1e594..7eb820e43a 100644
--- a/Gui/cfg.c
+++ b/Gui/cfg.c
@@ -132,6 +132,10 @@ int cfg_read( void )
char * cfg = get_path( "gui.conf" );
FILE * f;
+#ifdef USE_SETLOCALE
+ setlocale( LC_ALL,"C" );
+#endif
+
// -- read configuration
mp_msg( MSGT_GPLAYER,MSGL_STATUS,"[cfg] read config file: %s\n",cfg );
gui_conf=m_config_new( play_tree_new() );
@@ -177,6 +181,10 @@ int cfg_read( void )
}
free( cfg );
+#ifdef USE_SETLOCALE
+ setlocale( LC_ALL,"" );
+#endif
+
return 0;
}
@@ -187,7 +195,7 @@ int cfg_write( void )
int i;
#ifdef USE_SETLOCALE
- setlocale( LC_ALL,"" );
+ setlocale( LC_ALL,"C" );
#endif
// -- save configuration
@@ -198,26 +206,8 @@ int cfg_write( void )
switch ( gui_opts[i].type )
{
case CONF_TYPE_INT:
- case CONF_TYPE_FLAG: fprintf( f,"%s = %d\n",gui_opts[i].name,*( (int *)gui_opts[i].p ) ); break;
- case CONF_TYPE_FLOAT:
- #if 0
- fprintf( f,"%s = %f\n",gui_opts[i].name,*( (float *)gui_opts[i].p ) );
- #else
- #warning ugly hakk for fucking locale
- {
- char tmp[64];
- snprintf( tmp,64,"%f",*( (float *)gui_opts[i].p ) );
- // locale emulator
- // { char * c = strchr( tmp,'.' ); if ( c ) *c=','; }
- // ---
- { int i;
- for ( i=0;i < strlen( tmp );i++ )
- if ( ( tmp[i] != '.' )&&( ( tmp[i] < '0' )||( tmp[i] > '9' ) ) ) tmp[i]='.';
- }
- fprintf( f,"%s = %s\n",gui_opts[i].name,tmp );
- }
- #endif
- break;
+ case CONF_TYPE_FLAG: fprintf( f,"%s = %d\n",gui_opts[i].name,*( (int *)gui_opts[i].p ) ); break;
+ case CONF_TYPE_FLOAT: fprintf( f,"%s = %f\n",gui_opts[i].name,*( (float *)gui_opts[i].p ) ); break;
case CONF_TYPE_STRING:
{
char * tmp = *( (char **)gui_opts[i].p );
@@ -261,6 +251,10 @@ int cfg_write( void )
}
free( cfg );
+#ifdef USE_SETLOCALE
+ setlocale( LC_ALL,"" );
+#endif
+
return 0;
}