commit 50d23e825eba6425f88f46efa9c931ed3e0651c1
parent 9e72f0a430b55a17c1eb1cef6df589eaf84209e2
Author: Remy Noulin <loader2x@gmail.com>
Date: Wed, 19 Jul 2017 20:25:14 +0200
fix filenames with spaces
c/git-off.c | 5 ++++-
c/gitoff.c | 5 ++++-
2 files changed, 8 insertions(+), 2 deletions(-)
Diffstat:
2 files changed, 8 insertions(+), 2 deletions(-)
diff --git a/c/git-off.c b/c/git-off.c
@@ -1994,7 +1994,10 @@ void offCommands_clean() {
struct stat st;
stat(file, &st);
size = st.st_size;
- offFile = exec(sha, file);
+ quotedFile = malloc(strlen(file) + 1 + 4);
+ sprintf(quotedFile, "\"%s\"", file);
+ offFile = exec(sha, quotedFile);
+ free(quotedFile);
offFilePath = offHelpers_getOffFilePath(offFile);
fileDir = malloc(strlen(offHelpers_objectPath()) + strlen(offFilePath[1]) + 1 + 1);
diff --git a/c/gitoff.c b/c/gitoff.c
@@ -1993,7 +1993,10 @@ void offCommands_clean() {
struct stat st;
stat(file, &st);
size = st.st_size;
- offFile = exec(sha, file);
+ quotedFile = malloc(strlen(file) + 1 + 4);
+ sprintf(quotedFile, "\"%s\"", file);
+ offFile = exec(sha, quotedFile);
+ free(quotedFile);
offFilePath = offHelpers_getOffFilePath(offFile);
fileDir = malloc(strlen(offHelpers_objectPath()) + strlen(offFilePath[1]) + 1 + 1);