Update NSPR to the NSPR_HEAD_20091118 CVS tag (a snapshot of NSPR
authorWan-Teh Chang <wtc@google.com>
Wed, 18 Nov 2009 19:01:27 -0800
changeset 35031 2396b886239d02db5d4baea5ef92747fee23834d
parent 35030 0e64351635044d36e16c294e3871cfed6a3fb913
child 35032 f43b6bc2165bd9fc3bc202bcb6c8c6a133f45287
push idunknown
push userunknown
push dateunknown
bugs521306, 522992, 525221
milestone1.9.3a1pre
Update NSPR to the NSPR_HEAD_20091118 CVS tag (a snapshot of NSPR 4.8.3 pre-release). Includes fixes for bug 521306 (blocking1.9.2+), bug 522992, and bug 525221.
nsprpub/admin/repackage.sh
nsprpub/config/prdepend.h
nsprpub/config/rules.mk
nsprpub/configure
nsprpub/configure.in
nsprpub/pr/include/prinit.h
nsprpub/pr/src/io/prlog.c
nsprpub/pr/src/misc/prdtoa.c
nsprpub/pr/tests/dtoa.c
nsprpub/pr/tests/vercheck.c
--- a/nsprpub/admin/repackage.sh
+++ b/nsprpub/admin/repackage.sh
@@ -59,20 +59,20 @@
 # Note! Files written with Gnu tar are not readable by some non-Gnu
 # versions. Sun, in particular.
 # 
 # 
 # 
 # 
 # ------------------------------------------------------------------
 
-FROMTOP=/share/builds/components/nspr20/v4.8.2
-TOTOP=./v4.8.2
-NSPRDIR=nspr-4.8.2
-SOURCETAG=NSPR_4_8_2_RTM
+FROMTOP=/share/builds/components/nspr20/v4.8.3
+TOTOP=./v4.8.3
+NSPRDIR=nspr-4.8.3
+SOURCETAG=NSPR_4_8_3_RTM
 
 #
 # enumerate Unix object directories on /s/b/c
 UNIX_OBJDIRS="
 HP-UXB.11.11_64_DBG.OBJ
 HP-UXB.11.11_64_OPT.OBJ
 HP-UXB.11.11_DBG.OBJ
 HP-UXB.11.11_OPT.OBJ
--- a/nsprpub/config/prdepend.h
+++ b/nsprpub/config/prdepend.h
@@ -37,8 +37,9 @@
 
 /*
  * A dummy header file that is a dependency for all the object files.
  * Used to force a full recompilation of NSPR in Mozilla's Tinderbox
  * depend builds.  See comments in rules.mk.
  */
 
 #error "Do not include this header file."
+
--- a/nsprpub/config/rules.mk
+++ b/nsprpub/config/rules.mk
@@ -167,28 +167,23 @@ endif
 ALL_TRASH		= $(TARGETS) $(OBJS) $(RES) $(filter-out . .., $(OBJDIR)) LOGS TAGS $(GARBAGE) \
 			  $(NOSUCHFILE) \
 			  so_locations
 
 ifndef RELEASE_LIBS_DEST
 RELEASE_LIBS_DEST	= $(RELEASE_LIB_DIR)
 endif
 
+define MAKE_IN_DIR
+	$(MAKE) -C $(dir) $@
+
+endef # do not remove the blank line!
+
 ifdef DIRS
-LOOP_OVER_DIRS		=					\
-	@for d in $(DIRS); do					\
-		if test -d $$d; then				\
-			set -e;					\
-			echo "cd $$d; $(MAKE) $@";		\
-			$(MAKE) -C $$d $@;			\
-			set +e;					\
-		else						\
-			echo "Skipping non-directory $$d...";	\
-		fi;						\
-	done
+LOOP_OVER_DIRS = $(foreach dir,$(DIRS),$(MAKE_IN_DIR))
 endif
 
 ################################################################################
 
 all:: export
 
 export::
 	+$(LOOP_OVER_DIRS)
--- a/nsprpub/configure
+++ b/nsprpub/configure
@@ -690,17 +690,17 @@ echo "$ac_t""$build" 1>&6
 test "$host_alias" != "$target_alias" &&
   test "$program_prefix$program_suffix$program_transform_name" = \
     NONENONEs,x,x, &&
   program_prefix=${target_alias}-
 
 
 MOD_MAJOR_VERSION=4
 MOD_MINOR_VERSION=8
-MOD_PATCH_VERSION=2
+MOD_PATCH_VERSION=3
 NSPR_MODNAME=nspr20
 _HAVE_PTHREADS=
 USE_PTHREADS=
 USE_USER_PTHREADS=
 USE_NSPR_THREADS=
 USE_N32=
 USE_64=
 USE_CPLUS=
--- a/nsprpub/configure.in
+++ b/nsprpub/configure.in
@@ -45,17 +45,17 @@ AC_INIT(config/libc_r.h)
 AC_CONFIG_AUX_DIR(${srcdir}/build/autoconf)
 AC_CANONICAL_SYSTEM
 
 dnl ========================================================
 dnl = Defaults
 dnl ========================================================
 MOD_MAJOR_VERSION=4
 MOD_MINOR_VERSION=8
-MOD_PATCH_VERSION=2
+MOD_PATCH_VERSION=3
 NSPR_MODNAME=nspr20
 _HAVE_PTHREADS=
 USE_PTHREADS=
 USE_USER_PTHREADS=
 USE_NSPR_THREADS=
 USE_N32=
 USE_64=
 USE_CPLUS=
--- a/nsprpub/pr/include/prinit.h
+++ b/nsprpub/pr/include/prinit.h
@@ -58,21 +58,21 @@ PR_BEGIN_EXTERN_C
 /*
 ** NSPR's version is used to determine the likelihood that the version you
 ** used to build your component is anywhere close to being compatible with
 ** what is in the underlying library.
 **
 ** The format of the version string is
 **     "<major version>.<minor version>[.<patch level>] [<Beta>]"
 */
-#define PR_VERSION  "4.8.2"
+#define PR_VERSION  "4.8.3 Beta"
 #define PR_VMAJOR   4
 #define PR_VMINOR   8
-#define PR_VPATCH   2
-#define PR_BETA     PR_FALSE
+#define PR_VPATCH   3
+#define PR_BETA     PR_TRUE
 
 /*
 ** PRVersionCheck
 **
 ** The basic signature of the function that is called to provide version
 ** checking. The result will be a boolean that indicates the likelihood
 ** that the underling library will perform as the caller expects.
 **
--- a/nsprpub/pr/src/io/prlog.c
+++ b/nsprpub/pr/src/io/prlog.c
@@ -451,17 +451,17 @@ PR_IMPLEMENT(void) PR_LogPrint(const cha
     if (!logFile) {
         return;
     }
 
     if (outputTimeStamp) {
         PR_ExplodeTime(PR_Now(), PR_GMTParameters, &now);
         nb_tid = PR_snprintf(line, sizeof(line)-1,
                              "%04d-%02d-%02d %02d:%02d:%02d.%06d UTC - ",
-                             now.tm_year, now.tm_month, now.tm_mday,
+                             now.tm_year, now.tm_month + 1, now.tm_mday,
                              now.tm_hour, now.tm_min, now.tm_sec,
                              now.tm_usec);
     }
 
     me = PR_GetCurrentThread();
     nb_tid += PR_snprintf(line+nb_tid, sizeof(line)-nb_tid-1, "%ld[%p]: ",
 #if defined(_PR_BTHREADS)
                           me, me);
--- a/nsprpub/pr/src/misc/prdtoa.c
+++ b/nsprpub/pr/src/misc/prdtoa.c
@@ -1723,16 +1723,18 @@ PR_strtod
 					y = 10*y + c;
 				else if (nd <= DBL_DIG + 1)
 					z = 10*z + c;
 				nz = 0;
 				}
 			}
 		}
  dig_done:
+	if (nd > 64 * 1024)
+		goto ret0;
 	e = 0;
 	if (c == 'e' || c == 'E') {
 		if (!nd && !nz && !nz0) {
 			goto ret0;
 			}
 		s00 = s;
 		esign = 0;
 		switch(c = *++s) {
--- a/nsprpub/pr/tests/dtoa.c
+++ b/nsprpub/pr/tests/dtoa.c
@@ -42,30 +42,32 @@
  * PR_strtod
  * PR_dtoa
  * PR_cnvtf
  *
  * This file was ns/nspr/tests/dtoa.c, created by rrj on 1996/06/22.
  *
  *****************************************************************************/
 #include <stdio.h>
+#include <stdlib.h>
 #include <sys/types.h>
 #include <string.h>
 #include <locale.h>
 #include "prprf.h"
 #include "prdtoa.h"
 
 static int failed_already = 0;
 
 int main(int argc, char **argv)
 {
     double num;
     double num1;
     double zero = 0.0;
     char   cnvt[50];
+    char  *thousands;
     
     num = 1e24;
     num1 = PR_strtod("1e24",NULL);
     if(num1 != num){
 	fprintf(stderr,"Failed to convert numeric value %s\n","1e24");
         failed_already = 1;
     }
 
@@ -190,17 +192,16 @@ int main(int argc, char **argv)
     }
 
     PR_cnvtf(cnvt,sizeof(cnvt),20,num);
     if(strcmp("1.0000000001e+21",cnvt) != 0){
 	fprintf(stderr,"Failed to convert numeric value %lf %s\n",num,cnvt);
         failed_already = 1;
     }
 
-
     num = -1.0000000001e-21;
     num1 = PR_strtod("-1.0000000001e-21",NULL);
     if(num1 != num){
 	fprintf(stderr,"Failed to convert numeric value %s\n",
 		"-1.0000000001e-21");
         failed_already = 1;
     }
     PR_cnvtf(cnvt,sizeof(cnvt),20,num);
@@ -210,15 +211,35 @@ int main(int argc, char **argv)
     }
 
     /*
      * Bug 414772: should not exit with "Zero passed to d2b" in debug
      * build.
      */
     num1 = PR_strtod("4e-356",NULL);
 
+    /*
+     * A very long input with ~384K digits.
+     * Bug 516396: Should not crash.
+     * Bug 521306: Should return 0 without converting the input.
+     */
+#define LENGTH (384 * 1024)
+    thousands = (char *)malloc(LENGTH);
+    thousands[0] = '0';
+    thousands[1] = '.';
+    memset(&thousands[2], '1', LENGTH - 3);
+    thousands[LENGTH - 1] = '\0';
+    num = 0;
+    num1 = PR_strtod(thousands,NULL);
+    free(thousands);
+    if(num1 != num){
+        fprintf(stderr,"Failed to convert numeric value %s\n",
+                "0.1111111111111111...");
+        failed_already = 1;
+    }
+
     if (failed_already) {
         printf("FAILED\n");
     } else {
         printf("PASSED\n");
     }
     return failed_already;
 }
--- a/nsprpub/pr/tests/vercheck.c
+++ b/nsprpub/pr/tests/vercheck.c
@@ -47,30 +47,30 @@
  */
 
 #include "prinit.h"
 
 #include <stdio.h>
 #include <stdlib.h>
 
 /*
- * This release (4.8.2) is backward compatible with the
+ * This release (4.8.3) is backward compatible with the
  * 4.0.x, 4.1.x, 4.2.x, 4.3.x, 4.4.x, 4.5.x, 4.6.x, 4.7.x,
- * 4.8, and 4.8.1 releases.  It, of course, is compatible
+ * 4.8, 4.8.1, and 4.8.2 releases.  It, of course, is compatible
  * with itself.
  */
 static char *compatible_version[] = {
     "4.0", "4.0.1", "4.1", "4.1.1", "4.1.2", "4.1.3",
     "4.2", "4.2.1", "4.2.2", "4.3", "4.4", "4.4.1",
     "4.5", "4.5.1",
     "4.6", "4.6.1", "4.6.2", "4.6.3", "4.6.4", "4.6.5",
     "4.6.6", "4.6.7", "4.6.8",
     "4.7", "4.7.1", "4.7.2", "4.7.3", "4.7.4", "4.7.5",
     "4.7.6",
-    "4.8", "4.8.1", PR_VERSION
+    "4.8", "4.8.1", "4.8.2", PR_VERSION
 };
 
 /*
  * This release is not backward compatible with the old
  * NSPR 2.1 and 3.x releases.
  *
  * Any release is incompatible with future releases and
  * patches.