aboutsummaryrefslogtreecommitdiff
path: root/src/wine.c
diff options
context:
space:
mode:
authorJan200101 <sentrycraft123@gmail.com>2021-01-12 17:38:30 +0100
committerJan200101 <sentrycraft123@gmail.com>2021-01-12 17:38:30 +0100
commitbaca7635a3db27bae911ab6ebe928e5c2cc5a155 (patch)
treee9bde5656d208cd03f954a624aa564b195617220 /src/wine.c
parentdad8f3b9ecf5794f1b3c539878f91ee106d28448 (diff)
downloadpolecat-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.c20
1 files changed, 2 insertions, 18 deletions
diff --git a/src/wine.c b/src/wine.c
index d067ca6..1a21eb8 100644
--- a/src/wine.c
+++ b/src/wine.c
@@ -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
{