[LON-CAPA-cvs] cvs: loncom(version_2_11_X) /lonnet/perl lonnet.pm

raeburn raeburn at source.lon-capa.org
Thu Jun 12 23:34:55 EDT 2014


raeburn		Fri Jun 13 03:34:55 2014 EDT

  Modified files:              (Branch: version_2_11_X)
    /loncom/lonnet/perl	lonnet.pm 
  Log:
  - For 2.11
    - Backport 1.1262
  
  
Index: loncom/lonnet/perl/lonnet.pm
diff -u loncom/lonnet/perl/lonnet.pm:1.1172.2.50 loncom/lonnet/perl/lonnet.pm:1.1172.2.51
--- loncom/lonnet/perl/lonnet.pm:1.1172.2.50	Fri Jun 13 03:15:31 2014
+++ loncom/lonnet/perl/lonnet.pm	Fri Jun 13 03:34:54 2014
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # TCP networking package
 #
-# $Id: lonnet.pm,v 1.1172.2.50 2014/06/13 03:15:31 raeburn Exp $
+# $Id: lonnet.pm,v 1.1172.2.51 2014/06/13 03:34:54 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -11354,8 +11354,12 @@
 sub setup_random_from_rndseed {
     my ($rndseed)=@_;
     if ($rndseed =~/([,:])/) {
-	my ($num1,$num2)=split(/[,:]/,$rndseed);
-	&Math::Random::random_set_seed(abs($num1),abs($num2));
+	my ($num1,$num2) = map { abs($_); } (split(/[,:]/,$rndseed));
+        if ((!$num1) || (!$num2) || ($num1 > 2147483562) || ($num2 > 2147483398)) {
+            &Math::Random::random_set_seed_from_phrase($rndseed);
+        } else {
+            &Math::Random::random_set_seed($num1,$num2);
+        }
     } else {
 	&Math::Random::random_set_seed_from_phrase($rndseed);
     }




More information about the LON-CAPA-cvs mailing list