Browse Source

Ignore comment lines.

Avoid returning errors for comments and empty lines.
tags/v0.9.3
Michael Brown 17 years ago
parent
commit
5162f30028
1 changed files with 5 additions and 3 deletions
  1. 5
    3
      src/core/exec.c

+ 5
- 3
src/core/exec.c View File

133
 int system ( const char *command ) {
133
 int system ( const char *command ) {
134
 	char *args;
134
 	char *args;
135
 	int argc;
135
 	int argc;
136
-	int rc;
136
+	int rc = 0;
137
 
137
 
138
 	/* Obtain temporary modifiable copy of command line */
138
 	/* Obtain temporary modifiable copy of command line */
139
 	args = strdup ( command );
139
 	args = strdup ( command );
144
 	argc = split_args ( args, NULL );
144
 	argc = split_args ( args, NULL );
145
 
145
 
146
 	/* Create argv array and execute command */
146
 	/* Create argv array and execute command */
147
-	{
147
+	if ( argc ) {
148
 		char * argv[argc + 1];
148
 		char * argv[argc + 1];
149
 		
149
 		
150
 		split_args ( args, argv );
150
 		split_args ( args, argv );
151
 		argv[argc] = NULL;
151
 		argv[argc] = NULL;
152
-		rc = execv ( argv[0], argv );
152
+
153
+		if ( argv[0][0] != '#' )
154
+			rc = execv ( argv[0], argv );
153
 	}
155
 	}
154
 
156
 
155
 	free ( args );
157
 	free ( args );

Loading…
Cancel
Save