summaryrefslogtreecommitdiffstats
path: root/src/core/exec.c
diff options
context:
space:
mode:
authorMichael Brown2007-01-12 09:56:48 +0100
committerMichael Brown2007-01-12 09:56:48 +0100
commit5162f300284ca5238d7b337c8520bc02431719eb (patch)
treef57d83fe7119672e60a8e8eb04b24980ba6826fd /src/core/exec.c
parentAPI change: the raw image will no longer be (hypothetically) discarded (diff)
downloadipxe-5162f300284ca5238d7b337c8520bc02431719eb.tar.gz
ipxe-5162f300284ca5238d7b337c8520bc02431719eb.tar.xz
ipxe-5162f300284ca5238d7b337c8520bc02431719eb.zip
Ignore comment lines.
Avoid returning errors for comments and empty lines.
Diffstat (limited to 'src/core/exec.c')
-rw-r--r--src/core/exec.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/core/exec.c b/src/core/exec.c
index 61e7339a..8f1ef333 100644
--- a/src/core/exec.c
+++ b/src/core/exec.c
@@ -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 );