[dmraid 1/4] Parse "-cc" as required by man page.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a bit of a hack but....

The man page says that "-cc" will provide 'CSV' style output.
The code only provides this if "-c -c" is given.
This hack effectively maps "-cc" to "-c -c".

patch extracted from openSUSE package

From: hare@xxxxxxx
Signed-off-by: NeilBrown <neilb@xxxxxxx>

---
 tools/commands.c |   16 ++++++++++++----
 1 file changed, 12 insertions(+), 4 deletions(-)

--- dmraid.orig/tools/commands.c
+++ dmraid/tools/commands.c
@@ -142,10 +142,18 @@ check_identifiers(struct lib_context *lc
 		const char delim = *OPT_STR_SEPARATOR(lc);
 		char *p = optarg;
 
-		p = remove_white_space(lc, p, strlen(p));
-		p = collapse_delimiter(lc, p, strlen(p), delim);
-		if (!lc_strcat_opt(lc, o, p, delim))
-			return 0;
+		if (o == LC_COLUMN) {
+			while (p && *p == 'c') {
+				lc_inc_opt(lc, o);
+				p++;
+			}
+		}
+		if (p && *p) {
+			p = remove_white_space(lc, p, strlen(p));
+			p = collapse_delimiter(lc, p, strlen(p), delim);
+			if (!lc_strcat_opt(lc, o, p, delim))
+				return 0;
+		}
 	}
 
 	lc_inc_opt(lc, o);

--
dm-devel mailing list
dm-devel@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/dm-devel

[Index of Archives]     [DM Crypt]     [Fedora Desktop]     [ATA RAID]     [Fedora Marketing]     [Fedora Packaging]     [Fedora SELinux]     [Yosemite Discussion]     [KDE Users]     [Fedora Docs]

  Powered by Linux