From 909aa8f7c2e7ca95a522e5aabb6fac4a153fc7cf Mon Sep 17 00:00:00 2001 From: gisma Date: Mon, 26 Feb 2018 12:16:00 +0100 Subject: [PATCH] fix quoting of get version --- R/sagaControl.R | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/R/sagaControl.R b/R/sagaControl.R index 1f852ef..6b1a6cc 100644 --- a/R/sagaControl.R +++ b/R/sagaControl.R @@ -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 } @@ -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) } \ No newline at end of file