search for: quote_string_for_spawn

Displaying 2 results from an estimated 2 matches for "quote_string_for_spawn".

2020 Aug 20
0
[PATCH nbdkit 12/13] wrapper: Port the wrapper to run on Windows.
...l nbdkit. */ @@ -131,6 +132,45 @@ print_command (void) fputc ('\n', stderr); } +#ifdef WIN32 +/* Windows behaviour of _spawnvp is completely retarded: + * https://stackoverflow.com/questions/4146980/how-to-avoid-space-splitting-and-quote-removal-with-spawnvp + */ +static const char * +quote_string_for_spawn (const char *str) +{ + size_t i, len; + char *p, *ret = (char *) str; + + if (strchr (str, ' ') || strchr (str, '"')) { + len = strlen (str); + + p = ret = malloc (2 + len*2 + 1); + if (ret == NULL) { + perror ("malloc"); + exit (EXIT_FAILURE); +...
2020 Aug 20
15
[PATCH nbdkit 0/13] Port to Windows without using a separate library.
Also available here: https://github.com/rwmjones/nbdkit/tree/2020-windows-mingw-nolib After a lot of work I have made the port to Windows work without using a separate library. Instead, on Windows only, we build an "import library" (library of stubs) which resolves references to nbdkit_* functions in the main program and fixes up the plugin, basically the first technique outlined in