The help text of the addpart command lists RO as being uppercase,
but the code expects it to be lower-case.

Resolve this by supporting either case.

Signed-off-by: Ahmad Fatoum <[email protected]>
---
 lib/cmdlinepart.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/cmdlinepart.c b/lib/cmdlinepart.c
index 3e8c415c7ea6..16fa4605d822 100644
--- a/lib/cmdlinepart.c
+++ b/lib/cmdlinepart.c
@@ -74,7 +74,7 @@ int cmdlinepart_do_parse_one(const char *devname, const char 
*partstr,
 
        partstr = end;
 
-       if (*partstr == 'r' && *(partstr + 1) == 'o') {
+       if (!strncasecmp(partstr, "ro", 2)) {
                flags |= DEVFS_PARTITION_READONLY;
                end = (char *)(partstr + 2);
        }
-- 
2.47.3


Reply via email to