瀏覽代碼

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

tags/v0.9.4
Michael Brown 16 年之前
父節點
當前提交
4847d97372
共有 1 個文件被更改,包括 7 次插入7 次删除
  1. 7
    7
      src/hci/commands/config_cmd.c

+ 7
- 7
src/hci/commands/config_cmd.c 查看文件

@@ -5,7 +5,8 @@
5 5
 #include <gpxe/settings_ui.h>
6 6
 
7 7
 static int config_exec ( int argc, char **argv ) {
8
-	struct settings *settings = NULL;
8
+	char *settings_name;
9
+	struct settings *settings;
9 10
 	int rc;
10 11
 
11 12
 	if ( argc > 2 ) {
@@ -14,12 +15,11 @@ static int config_exec ( int argc, char **argv ) {
14 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 25
 	if ( ( rc = settings_ui ( settings ) ) != 0 ) {

Loading…
取消
儲存