Skip to contentSkip to conversation

Make no options to fdt print default to '/'

PATCH New Kumar Gala 2 participants 2 messages Oct 25, 2007 – Oct 26, 2007

lore
Share & tools
lore

Kumar Gala

author
#0 lore raw

PATCH 1/1 Make no options to fdt print default to '/'

---
 common/cmd_fdt.c |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)
common/cmd_fdt.c +5 -1
index b64cb91..ef17039 100644
@@ -232,6 +232,7 @@ int do_fdt (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
 		char *pathp;		/* path */
 		char *prop;		/* property */
 		int  ret;		/* return value */
+		static char root[2] = "/";
 
 		/*
 		 * list is an alias for print, but limited to 1 level
@@ -244,7 +245,10 @@ int do_fdt (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
 		 * Get the starting path.  The root node is an oddball,
 		 * the offset is zero and has no name.
 		 */
-		pathp = argv[2];
+		if (argc == 2)
+			pathp = root;
+		else
+			pathp = argv[2];
 		if (argc > 3)
 			prop = argv[3];
 		else
Signature · 1 line
1.5.2.4
#1 lore raw

PATCH 1/1 Make no options to fdt print default to '/'

Quoted 4 lines · Kumar Gala
---
 common/cmd_fdt.c |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

Thanks, added to the "in" basket.

gvb