The attached patch fixes willemf's problem.
it set the default locale to the Minimal c locale which prevent put_formate() from replacing the decimal point with a comma in floating point numbers.

--
Regards,
Gehad Elrobey

>From 6e4965fbb447510ba76992d3495e28bfb7c17401 Mon Sep 17 00:00:00 2001
From: Gehad elrobey <[email protected]>
Date: Sat, 5 Apr 2014 19:52:39 +0200
Subject: [PATCH] Different system locale settings cause the export to crash

While exporting the floating points numbers sometimes the
decimal point is replaced with a comma which is system dependant
and cause the JS to crash.

setlocal() is used to restore the default c locale.

Signed-off-by: Gehad elrobey <[email protected]>
---
 worldmap-save.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/worldmap-save.c b/worldmap-save.c
index 0c40bc3..8ba0718 100644
--- a/worldmap-save.c
+++ b/worldmap-save.c
@@ -2,6 +2,7 @@
 #include <stdlib.h>
 #include <string.h>
 #include <stdio.h>
+#include <locale.h>
 #include "dive.h"
 #include "membuffer.h"
 #include "worldmap-save.h"
@@ -136,6 +137,7 @@ void insert_javascript(struct membuffer *b)
 
 void export(struct membuffer *b)
 {
+	setlocale(LC_ALL,"C");
 	insert_html_header(b);
 	insert_css(b);
 	insert_javascript(b);
-- 
1.8.3.2

_______________________________________________
subsurface mailing list
[email protected]
http://lists.hohndel.org/cgi-bin/mailman/listinfo/subsurface

Reply via email to