Browse Source

[settings] Allow "config" command to access root settings block

tags/v0.9.4
Michael Brown 16 years ago
parent
commit
4847d97372
1 changed files with 7 additions and 7 deletions
  1. 7
    7
      src/hci/commands/config_cmd.c

+ 7
- 7
src/hci/commands/config_cmd.c View File

5
 #include <gpxe/settings_ui.h>
5
 #include <gpxe/settings_ui.h>
6
 
6
 
7
 static int config_exec ( int argc, char **argv ) {
7
 static int config_exec ( int argc, char **argv ) {
8
-	struct settings *settings = NULL;
8
+	char *settings_name;
9
+	struct settings *settings;
9
 	int rc;
10
 	int rc;
10
 
11
 
11
 	if ( argc > 2 ) {
12
 	if ( argc > 2 ) {
14
 		return 1;
15
 		return 1;
15
 	}
16
 	}
16
 
17
 
17
-	if ( argc == 2 ) {
18
-		settings = find_settings ( argv[1] );
19
-		if ( ! settings ) {
20
-			printf ( "No such scope \"%s\"\n", argv[1] );
21
-			return 1;
22
-		}
18
+	settings_name = ( ( argc == 2 ) ? argv[1] : "" );
19
+	settings = find_settings ( argv[1] );
20
+	if ( ! settings ) {
21
+		printf ( "No such scope \"%s\"\n", settings_name );
22
+		return 1;
23
 	}
23
 	}
24
 
24
 
25
 	if ( ( rc = settings_ui ( settings ) ) != 0 ) {
25
 	if ( ( rc = settings_ui ( settings ) ) != 0 ) {

Loading…
Cancel
Save