mirror of
https://github.com/xcat2/xNBA.git
synced 2025-01-31 05:17:34 +00:00
Ignore comment lines.
Avoid returning errors for comments and empty lines.
This commit is contained in:
parent
48e0fc3447
commit
5162f30028
@ -133,7 +133,7 @@ static int split_args ( char *args, char * argv[] ) {
|
||||
int system ( const char *command ) {
|
||||
char *args;
|
||||
int argc;
|
||||
int rc;
|
||||
int rc = 0;
|
||||
|
||||
/* Obtain temporary modifiable copy of command line */
|
||||
args = strdup ( command );
|
||||
@ -144,12 +144,14 @@ int system ( const char *command ) {
|
||||
argc = split_args ( args, NULL );
|
||||
|
||||
/* Create argv array and execute command */
|
||||
{
|
||||
if ( argc ) {
|
||||
char * argv[argc + 1];
|
||||
|
||||
split_args ( args, argv );
|
||||
argv[argc] = NULL;
|
||||
rc = execv ( argv[0], argv );
|
||||
|
||||
if ( argv[0][0] != '#' )
|
||||
rc = execv ( argv[0], argv );
|
||||
}
|
||||
|
||||
free ( args );
|
||||
|
Loading…
x
Reference in New Issue
Block a user