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

Function argv_from_shell

src/engine/execcmd.cpp:43–71  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

41 */
42
43void argv_from_shell( char const * * argv, LIST * shell, char const * command,
44 int32_t const slot )
45{
46 static char jobno[ 12 ];
47
48 int i;
49 int gotpercent = 0;
50 LISTITER iter = list_begin( shell );
51 LISTITER end = list_end( shell );
52
53 assert( 0 <= slot );
54 assert( slot < 999 );
55 sprintf( jobno, "%d", slot + 1 );
56
57 for ( i = 0; iter != end && i < MAXARGC; ++i, iter = list_next( iter ) )
58 {
59 switch ( object_str( list_item( iter ) )[ 0 ] )
60 {
61 case '%': argv[ i ] = command; ++gotpercent; break;
62 case '!': argv[ i ] = jobno; break;
63 default : argv[ i ] = object_str( list_item( iter ) );
64 }
65 }
66
67 if ( !gotpercent )
68 argv[ i++ ] = command;
69
70 argv[ i ] = NULL;
71}
72
73
74/* Returns whether the given command string contains lines longer than the given

Callers 2

exec_cmdFunction · 0.85
exec_cmdFunction · 0.85

Calls 3

list_beginFunction · 0.85
list_endFunction · 0.85
object_strFunction · 0.85

Tested by

no test coverage detected