Index: src/library/stats/R/distn.R
===================================================================
--- src/library/stats/R/distn.R	(revision 44730)
+++ src/library/stats/R/distn.R	(working copy)
@@ -19,7 +19,7 @@
     .Internal(pexp(q, 1/rate, lower.tail, log.p))
 qexp <- function(p, rate=1, lower.tail = TRUE, log.p = FALSE)
     .Internal(qexp(p, 1/rate, lower.tail, log.p))
-rexp <- function(n, rate=1) .Internal(rexp(n, 1/rate))
+rexp <- function(n, rate=1) .Internal(rexp(n, ifelse(rate==-Inf, -Inf, 1/rate)))
 
 dunif <- function(x, min=0, max=1, log = FALSE)
     .Internal(dunif(x, min, max, log))
Index: src/nmath/rexp.c
===================================================================
--- src/nmath/rexp.c	(revision 44730)
+++ src/nmath/rexp.c	(working copy)
@@ -32,7 +32,7 @@
 
 double rexp(double scale)
 {
-    if (!R_FINITE(scale) || scale <= 0.0)
+    if (!R_FINITE(scale) || scale < 0.0)
 	ML_ERR_return_NAN;
 
     return scale * exp_rand();
Index: src/nmath/rlnorm.c
===================================================================
--- src/nmath/rlnorm.c	(revision 44730)
+++ src/nmath/rlnorm.c	(working copy)
@@ -31,8 +31,9 @@
 
 double rlnorm(double logmean, double logsd)
 {
-    if(!R_FINITE(logmean) || !R_FINITE(logsd) || logsd < 0.)
+    /* synchronise with changes to rnorm.c in r44717 */
+    if(ISNAN(logmean) || !R_FINITE(logsd) || logsd < 0.)
 	ML_ERR_return_NAN;
-
+    
     return exp(rnorm(logmean, logsd));
 }
Index: tests/reg-tests-1.R
===================================================================
--- tests/reg-tests-1.R	(revision 44730)
+++ tests/reg-tests-1.R	(working copy)
@@ -5099,10 +5099,12 @@
 op <- options(warn=2)
 m <- c(-Inf,Inf)
 stopifnot(rnorm(2, mean = m) == m)
+stopifnot(rlnorm(2, mean = m) == c(0, Inf))
+stopifnot(rexp(1, Inf) == 0)
 rt(1, Inf)
 R <- list(try(rnorm(2, numeric())),
           try(rexp (2, numeric())),
-          try(rexp (2, Inf)),# already gave warning
+          try(rexp (2, -Inf)),
           try(rnorm(2, c(1,NA))),
           try(rnorm(1, sd = Inf)) )
 options(op)
