Linux Device Mapper development
 help / color / mirror / Atom feed
From: neilb@suse.de
To: dm-devel@redhat.com
Subject: [dmraid 1/4] Parse "-cc" as required by man page.
Date: Thu, 17 Dec 2009 16:44:11 +1100	[thread overview]
Message-ID: <20091217054515.427662058@suse.de> (raw)
In-Reply-To: 20091217054410.410634166@suse.de

[-- Attachment #1: dmraid_duplicate_args.patch --]
[-- Type: text/plain, Size: 1035 bytes --]

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@suse.de
Signed-off-by: NeilBrown <neilb@suse.de>

---
 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);

  reply	other threads:[~2009-12-17  5:44 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-12-17  5:44 [dmraid 0/4] A few patches for dmraid neilb
2009-12-17  5:44 ` neilb [this message]
2009-12-17 16:50   ` [dmraid 1/4] Parse "-cc" as required by man page Heinz Mauelshagen
2009-12-17  5:44 ` [dmraid 2/4] Avoid fd leak in remove_device_partitions neilb
2009-12-17  5:44 ` [dmraid 3/4] Fix min/max macros neilb
2009-12-17  5:44 ` [dmraid 4/4] Fix two issues with installing shared libraries neilb

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20091217054515.427662058@suse.de \
    --to=neilb@suse.de \
    --cc=dm-devel@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox