Skip to content

Commit

Permalink
Fix PR#16329.
Browse files Browse the repository at this point in the history
git-svn-id: https://svn.r-project.org/R/trunk@68296 00db46b3-68df-0310-9c12-caf00c1e9a41
  • Loading branch information
murdoch committed May 1, 2015
1 parent 58ab247 commit 317580e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
3 changes: 3 additions & 0 deletions doc/NEWS.Rd
Expand Up @@ -112,6 +112,9 @@
\item (Windows only) \code{choose.files()} would occasionally
include characters from the result of an earlier call in
the result of a later one. (\PR{16270})

\item A change in \code{RSiteSearch()} in \R 3.2.0 caused it to
submit invalid URLs. (\PR{16329})
}
}
}
Expand Down
7 changes: 3 additions & 4 deletions src/library/utils/R/RSiteSearch.R
@@ -1,7 +1,7 @@
# File src/library/utils/R/RSiteSearch.R
# Part of the R package, http://www.R-project.org
#
# Copyright (C) 1995-2012 The R Core Team
# Copyright (C) 1995-2015 The R Core Team
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
Expand All @@ -25,7 +25,7 @@ RSiteSearch <- function(string,
matchesPerPage = 20)
{
string <- paste0("http://search.r-project.org/cgi-bin/namazu.cgi?query=",
gsub(" ", "+", string))
URLencode(gsub(" ", "+", string), reserved = TRUE))
mpp <- paste0("max=", matchesPerPage)
format <- paste0("result=", match.arg(format))

Expand All @@ -47,8 +47,7 @@ RSiteSearch <- function(string,
## we know this is a http:// URL, so encoding should be safe.
## it seems that firefox on Mac OS needs it for {...}
## OTOH, Namazu does not decode in, say, sort=date:late.
qstring <- paste(URLencode(string, reserved = TRUE),
mpp, format, sortby, restr, sep = "&")
qstring <- paste(string, mpp, format, sortby, restr, sep = "&")
browseURL(qstring)
cat(gettextf("A search query has been submitted to %s",
"http://search.r-project.org"), "\n", sep = "")
Expand Down

0 comments on commit 317580e

Please sign in to comment.