summaryrefslogtreecommitdiff
path: root/src/drv/cdps.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/drv/cdps.c')
-rw-r--r--src/drv/cdps.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/drv/cdps.c b/src/drv/cdps.c
index 08d6ba7..0db3590 100644
--- a/src/drv/cdps.c
+++ b/src/drv/cdps.c
@@ -9,6 +9,7 @@
#include <string.h>
#include <time.h>
#include <math.h>
+#include <locale.h>
#include "cd.h"
#include "cd_private.h"
@@ -64,6 +65,7 @@ struct _cdCtxCanvas
int level1; /* if true generates level 1 only function calls */
int landscape; /* page orientation */
int debug; /* print debug strings in the file */
+ char* old_locale;
float rotate_angle;
int rotate_center_x,
@@ -391,6 +393,12 @@ static void cdkillcanvas(cdCtxCanvas *ctxcanvas)
fclose(ctxcanvas->file);
+ if (ctxcanvas->old_locale)
+ {
+ setlocale(LC_NUMERIC, ctxcanvas->old_locale);
+ free(ctxcanvas->old_locale);
+ }
+
memset(ctxcanvas, 0, sizeof(cdCtxCanvas));
free(ctxcanvas);
}
@@ -1965,6 +1973,10 @@ static void cdcreatecanvas(cdCanvas* canvas, void *data)
ctxcanvas = (cdCtxCanvas *)malloc(sizeof(cdCtxCanvas));
memset(ctxcanvas, 0, sizeof(cdCtxCanvas));
+ /* SVN specification states that number must use dot as decimal separator */
+ ctxcanvas->old_locale = cdStrDup(setlocale(LC_NUMERIC, NULL));
+ setlocale(LC_NUMERIC, "C");
+
line += cdGetFileName(line, filename);
if (filename[0] == 0)
return;