Skip to content

Commit 30bb059

Browse files
committed
only quote build paths if it appears to be necessary
1 parent 2046ea5 commit 30bb059

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

R/utils.R

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,19 @@
11

22
# generate paths consumable by the compilers and linkers
3-
# in particular, on Windows, this means the path _cannot_ be quoted !!
3+
# in particular, on Windows and Solaris, this means the path _cannot_ be quoted !!
44
asBuildPath <- function(path) {
55

6-
if (!is_windows())
7-
return(shQuote(path))
8-
96
# normalize paths using forward slashes
107
path <- normalizePath(path, winslash = "/", mustWork = FALSE)
118

129
# prefer short path names if the path has spaces
13-
if (grepl(" ", path, fixed = TRUE))
10+
if (is_windows() && grepl(" ", path, fixed = TRUE))
1411
path <- utils::shortPathName(path)
1512

13+
# if we still have spaces, and we're not Windows or Solaris, try quoting
14+
if (grepl(" ", path, fixed = TRUE) && !is_windows() && !is_solaris())
15+
path <- shQuote(path)
16+
1617
# return path
1718
return(path)
1819

0 commit comments

Comments
 (0)