MCPcopy Create free account
hub / github.com/boostorg/build / windows_popen_wrapper

Function windows_popen_wrapper

v2/engine/builtins.c:2337–2359  ·  view source on GitHub ↗

* This wrapper is a workaround for a funny _popen() feature on Windows * where it eats external quotes in some cases. The bug seems to be related * to the quote stripping functionality used by the Windows cmd.exe * interpreter when its /S is not specified. * * Cleaned up quote from the cmd.exe help screen as displayed on Windows XP * SP3: * * 1. If all of

Source from the content-addressed store, hash-verified

2335 * (03.06.2008.) (Jurko)
2336 */
2337 static FILE * windows_popen_wrapper( char const * command,
2338 char const * mode )
2339 {
2340 int const extra_command_quotes_needed = !!strchr( command, '"' );
2341 string quoted_command;
2342 FILE * result;
2343
2344 if ( extra_command_quotes_needed )
2345 {
2346 string_new( &quoted_command );
2347 string_append( &quoted_command, "\"" );
2348 string_append( &quoted_command, command );
2349 string_append( &quoted_command, "\"" );
2350 command = quoted_command.value;
2351 }
2352
2353 result = _popen( command, "r" );
2354
2355 if ( extra_command_quotes_needed )
2356 string_free( &quoted_command );
2357
2358 return result;
2359 }
2360#endif /* defined(_MSC_VER) || defined(__BORLANDC__) */
2361
2362

Callers

nothing calls this directly

Calls 3

string_newFunction · 0.85
string_appendFunction · 0.85
string_freeFunction · 0.85

Tested by

no test coverage detected