Skip to content

Commit

Permalink
fix quoting of get version
Browse files Browse the repository at this point in the history
  • Loading branch information
gisma committed Feb 26, 2018
1 parent 4134f98 commit 909aa8f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions R/sagaControl.R
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ getrowSagaVer<- function (paths){
sep = ifelse(Sys.info()["sysname"]=="Windows", "\\", "/")
highestVer<-"2.0.8"
for (i in 1:nrow(paths)){
tmp<- strsplit(x = system(paste0(paste0(paths$binDir[i],sep,scmd)," --version"),intern = TRUE),split = "SAGA Version: ")[[1]][2]
tmp<- strsplit(x = system(paste0(paste0(shQuote(paths$binDir[i]),sep,scmd)," --version"),intern = TRUE),split = "SAGA Version: ")[[1]][2]
highestVer <- max(tmp,highestVer)
pathI <- i
}
Expand All @@ -181,6 +181,6 @@ getrowSagaVer<- function (paths){
getSagaVer<- function (paths){
sep = ifelse(Sys.info()["sysname"]=="Windows", "\\", "/")
scmd = ifelse(Sys.info()["sysname"]=="Windows", "saga_cmd.exe", "saga_cmd")
sagaVersion<- strsplit(x = system(paste0(paste0(paths,sep,scmd)," --version"),intern = TRUE),split = "SAGA Version: ")[[1]][2]
sagaVersion<- strsplit(x = system(paste0(paste0(shQuote(paths),sep,scmd)," --version"),intern = TRUE),split = "SAGA Version: ")[[1]][2]
return (sagaVersion)
}

0 comments on commit 909aa8f

Please sign in to comment.