[PATCH 11/17] cmndlinepart: skip devname if partstr already contains it

Sascha Hauer s.hauer at pengutronix.de
Thu Feb 12 00:54:28 PST 2015


When the partition name already starts with "devname." skip this
when adding the partition.

Signed-off-by: Sascha Hauer <s.hauer at pengutronix.de>
---
 lib/cmdlinepart.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/lib/cmdlinepart.c b/lib/cmdlinepart.c
index df6f17a..d7d4441 100644
--- a/lib/cmdlinepart.c
+++ b/lib/cmdlinepart.c
@@ -61,7 +61,8 @@ int cmdlinepart_do_parse_one(const char *devname, const char *partstr,
 			return -EINVAL;
 		}
 
-		if (partition_flags & CMDLINEPART_ADD_DEVNAME)
+		if ((partition_flags & CMDLINEPART_ADD_DEVNAME) &&
+				strncmp(devname, partstr, strlen(devname)))
 			sprintf(buf, "%s.", devname);
 		memcpy(buf + strlen(buf), partstr, end - partstr);
 
-- 
2.1.4




More information about the barebox mailing list