<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" /><style type="text/css"><!--
#msg dl { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre, #msg p { overflow: auto; background: #ffc; border: 1px #fc0 solid; padding: 6px; }
#msg ul { overflow: auto; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<title>[28771] trunk/JavaScriptCore</title>
</head>
<body>

<div id="msg">
<dl>
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/28771">28771</a></dd>
<dt>Author</dt> <dd>ap@webkit.org</dd>
<dt>Date</dt> <dd>2007-12-16 09:31:35 -0800 (Sun, 16 Dec 2007)</dd>
</dl>

<h3>Log Message</h3>
<pre>        Reviewed by Darin.

        http://bugs.webkit.org/show_bug.cgi?id=16162
        Problems with float parsing on Linux (locale-dependent parsing was used).

        * kjs/dtoa.cpp: Removed USE_LOCALE to reduce future confusion.
        * kjs/lexer.cpp: (KJS::Lexer::lex): Parse with kjs_strtod, not the system one.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkJavaScriptCoreChangeLog">trunk/JavaScriptCore/ChangeLog</a></li>
<li><a href="#trunkJavaScriptCorekjsdtoacpp">trunk/JavaScriptCore/kjs/dtoa.cpp</a></li>
<li><a href="#trunkJavaScriptCorekjslexercpp">trunk/JavaScriptCore/kjs/lexer.cpp</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkJavaScriptCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/JavaScriptCore/ChangeLog (28770 => 28771)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/JavaScriptCore/ChangeLog        2007-12-16 16:16:17 UTC (rev 28770)
+++ trunk/JavaScriptCore/ChangeLog        2007-12-16 17:31:35 UTC (rev 28771)
</span><span class="lines">@@ -1,3 +1,13 @@
</span><ins>+2007-12-16  Alexey Proskuryakov  &lt;ap@webkit.org&gt;
+
+        Reviewed by Darin.
+
+        http://bugs.webkit.org/show_bug.cgi?id=16162
+        Problems with float parsing on Linux (locale-dependent parsing was used).
+
+        * kjs/dtoa.cpp: Removed USE_LOCALE to reduce future confusion.
+        * kjs/lexer.cpp: (KJS::Lexer::lex): Parse with kjs_strtod, not the system one.
+
</ins><span class="cx"> 2007-12-14  Alp Toker  &lt;alp@atoker.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Reviewed by Mark Rowe.
</span></span></pre></div>
<a id="trunkJavaScriptCorekjsdtoacpp"></a>
<div class="modfile"><h4>Modified: trunk/JavaScriptCore/kjs/dtoa.cpp (28770 => 28771)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/JavaScriptCore/kjs/dtoa.cpp        2007-12-16 16:16:17 UTC (rev 28770)
+++ trunk/JavaScriptCore/kjs/dtoa.cpp        2007-12-16 17:31:35 UTC (rev 28771)
</span><span class="lines">@@ -150,7 +150,6 @@
</span><span class="cx">  *        some compilers and was always used prior to 19990916, but it
</span><span class="cx">  *        is not strictly legal and can cause trouble with aggressively
</span><span class="cx">  *        optimizing compilers (e.g., gcc 2.95.1 under -O2).
</span><del>- * #define USE_LOCALE to use the current locale's decimal_point value.
</del><span class="cx">  * #define SET_INEXACT if IEEE arithmetic is being used and extra
</span><span class="cx">  *        computation should be done to set the inexact flag when the
</span><span class="cx">  *        result is inexact and avoid setting inexact when the result
</span><span class="lines">@@ -202,10 +201,6 @@
</span><span class="cx"> #include &lt;stdlib.h&gt;
</span><span class="cx"> #include &lt;string.h&gt;
</span><span class="cx"> 
</span><del>-#ifdef USE_LOCALE
-#include &lt;locale.h&gt;
-#endif
-
</del><span class="cx"> #ifdef MALLOC
</span><span class="cx"> #ifdef KR_headers
</span><span class="cx"> extern char *MALLOC();
</span><span class="lines">@@ -1559,9 +1554,6 @@
</span><span class="cx"> #ifdef Honor_FLT_ROUNDS
</span><span class="cx">         int rounding;
</span><span class="cx"> #endif
</span><del>-#ifdef USE_LOCALE
-        CONST_ char *s2;
-#endif
</del><span class="cx"> 
</span><span class="cx">         sign = nz0 = nz = 0;
</span><span class="cx">         dval(rv) = 0.;
</span><span class="lines">@@ -1600,25 +1592,6 @@
</span><span class="cx">                 else if (nd &lt; 16)
</span><span class="cx">                         z = 10*z + c - '0';
</span><span class="cx">         nd0 = nd;
</span><del>-#ifdef USE_LOCALE
-        s1 = localeconv()-&gt;decimal_point;
-        if (c == *s1) {
-                c = '.';
-                if (*++s1) {
-                        s2 = s;
-                        for(;;) {
-                                if (*++s2 != *s1) {
-                                        c = 0;
-                                        break;
-                                        }
-                                if (!*++s1) {
-                                        s = s2;
-                                        break;
-                                        }
-                                }
-                        }
-                }
-#endif
</del><span class="cx">         if (c == '.') {
</span><span class="cx">                 c = *++s;
</span><span class="cx">                 if (!nd) {
</span></span></pre></div>
<a id="trunkJavaScriptCorekjslexercpp"></a>
<div class="modfile"><h4>Modified: trunk/JavaScriptCore/kjs/lexer.cpp (28770 => 28771)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/JavaScriptCore/kjs/lexer.cpp        2007-12-16 16:16:17 UTC (rev 28770)
+++ trunk/JavaScriptCore/kjs/lexer.cpp        2007-12-16 17:31:35 UTC (rev 28771)
</span><span class="lines">@@ -24,6 +24,7 @@
</span><span class="cx"> #include &quot;config.h&quot;
</span><span class="cx"> #include &quot;lexer.h&quot;
</span><span class="cx"> 
</span><ins>+#include &quot;dtoa.h&quot;
</ins><span class="cx"> #include &quot;function.h&quot;
</span><span class="cx"> #include &quot;nodes.h&quot;
</span><span class="cx"> #include &lt;ctype.h&gt;
</span><span class="lines">@@ -459,7 +460,7 @@
</span><span class="cx"> 
</span><span class="cx">   double dval = 0;
</span><span class="cx">   if (state == Number) {
</span><del>-    dval = strtod(m_buffer8.data(), 0L);
</del><ins>+    dval = kjs_strtod(m_buffer8.data(), 0L);
</ins><span class="cx">   } else if (state == Hex) { // scan hex numbers
</span><span class="cx">     const char* p = m_buffer8.data() + 2;
</span><span class="cx">     while (char c = *p++) {
</span></span></pre>
</div>
</div>

</body>
</html>