diff options
author | Jan200101 <sentrycraft123@gmail.com> | 2021-01-12 17:38:30 +0100 |
---|---|---|
committer | Jan200101 <sentrycraft123@gmail.com> | 2021-01-12 17:38:30 +0100 |
commit | baca7635a3db27bae911ab6ebe928e5c2cc5a155 (patch) | |
tree | e9bde5656d208cd03f954a624aa564b195617220 /src/wine.c | |
parent | dad8f3b9ecf5794f1b3c539878f91ee106d28448 (diff) | |
download | polecat-baca7635a3db27bae911ab6ebe928e5c2cc5a155.tar.gz polecat-baca7635a3db27bae911ab6ebe928e5c2cc5a155.zip |
replace float with int math, silence conversions, improve wine call […]
improve parser logic and math reuse
Diffstat (limited to 'src/wine.c')
-rw-r--r-- | src/wine.c | 20 |
1 files changed, 2 insertions, 18 deletions
@@ -233,24 +233,8 @@ 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 - strncat(winepath, " \"", sizeof(winepath) - strlen(winepath) - 1); - strncat(winepath, argv[i], sizeof(winepath) - strlen(winepath) - 1); - strncat(winepath, "\"", sizeof(winepath) - strlen(winepath) - 1); - } - - return system(winepath); + argv[1] = winepath; + return execvp(winepath, argv+1); } else { |