From 486a1459319a656b0b4b218c6451e629858d6060 Mon Sep 17 00:00:00 2001 From: Marcel Rodrigues Date: Sun, 19 Jun 2016 16:51:58 -0300 Subject: [PATCH] Fix pathname splitting when running external programs. --- rover.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/rover.c b/rover.c index afe7d34..47699d3 100644 --- a/rover.c +++ b/rover.c @@ -324,8 +324,9 @@ open_with_env(const char *env, char *path) if (program) { #ifdef RV_SHELL strncpy(BUF1, program, BUFLEN - 1); - strncat(BUF1, " ", BUFLEN - strlen(program) - 1); - strncat(BUF1, path, BUFLEN - strlen(program) - strlen(path) - 2); + strncat(BUF1, " '", BUFLEN - strlen(program) - 1); + strncat(BUF1, path, BUFLEN - strlen(program) - 3); + strncat(BUF1, "'", BUFLEN - strlen(program) - strlen(path) - 3); spawn((char *[]) {RV_SHELL, "-c", BUF1, NULL}); #else spawn((char *[]) {program, path, NULL}); -- 2.11.4.GIT