wineps: fix ppd reading in certain locales

Huw D M Davies h.davies1 at physics.ox.ac.uk
Fri Nov 26 08:31:31 CST 2004


        Huw Davies <huw at codeweavers.com>
        Protect sscanfs with a "C" locale so that they still work with
        new glibcs in a locale doesn't use a '.' as a decimal separator.
-- 
Huw Davies
huw at codeweavers.com
Index: dlls/wineps/ppd.c
===================================================================
RCS file: /home/wine/wine/dlls/wineps/ppd.c,v
retrieving revision 1.17
diff -u -p -r1.17 ppd.c
--- dlls/wineps/ppd.c	21 Nov 2004 15:39:02 -0000	1.17
+++ dlls/wineps/ppd.c	26 Nov 2004 15:19:11 -0000
@@ -23,6 +23,7 @@
 #include <stdarg.h>
 #include <stdio.h>
 #include <ctype.h>
+#include <locale.h>
 #include "windef.h"
 #include "winbase.h"
 #include "wine/debug.h"
@@ -710,8 +711,10 @@ PPD *PSDRV_ParsePPD(char *fname)
 #define PIA page->ImageableArea
 	    if(!PIA) {
  	        PIA = HeapAlloc( PSDRV_Heap, 0, sizeof(*PIA) );
+                push_lc_numeric("C");
 		sscanf(tuple.value, "%f%f%f%f", &PIA->llx, &PIA->lly,
 						&PIA->urx, &PIA->ury);
+                pop_lc_numeric();
 	    }
 #undef PIA
 	}
@@ -733,7 +736,9 @@ PPD *PSDRV_ParsePPD(char *fname)
 #define PD page->PaperDimension
 	    if(!PD) {
  	        PD = HeapAlloc( PSDRV_Heap, 0, sizeof(*PD) );
+                push_lc_numeric("C");
 		sscanf(tuple.value, "%f%f", &PD->x, &PD->y);
+                pop_lc_numeric();
 	    }
 #undef PD
 	}



More information about the wine-patches mailing list