diff options
author | Jan200101 <sentrycraft123@gmail.com> | 2021-01-02 02:44:32 +0100 |
---|---|---|
committer | Jan200101 <sentrycraft123@gmail.com> | 2021-01-02 02:44:32 +0100 |
commit | dad8f3b9ecf5794f1b3c539878f91ee106d28448 (patch) | |
tree | 70d3373f350040a99b01b29376197b21fd3d9693 /src/wine.c | |
parent | 8cb74a7817bc5769a28a12cabb90276947f8051a (diff) | |
download | polecat-dad8f3b9ecf5794f1b3c539878f91ee106d28448.tar.gz polecat-dad8f3b9ecf5794f1b3c539878f91ee106d28448.zip |
quote executable/script path to not deal with whitespace problems
Diffstat (limited to 'src/wine.c')
-rw-r--r-- | src/wine.c | 9 |
1 files changed, 9 insertions, 0 deletions
@@ -233,6 +233,15 @@ COMMAND(wine, run) if (isFile(winepath)) { + // quote the winepath so whitespace won't cause trouble + { + char winepathcpy[PATH_MAX] = {0}; + strncat(winepathcpy, "\"", sizeof(winepathcpy) - strlen(winepathcpy) - 1); + strncat(winepathcpy, winepath, sizeof(winepathcpy) - strlen(winepathcpy) - 1); + strncat(winepathcpy, "\"", sizeof(winepathcpy) - strlen(winepathcpy) - 1); + strncpy(winepath, winepathcpy, sizeof(winepathcpy)); + } + for (int i = 2; i < argc; ++i) { // make sure the passed arguments are in quotes so spaces don't cause problems |