public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Anthony G. Basile" <blueness@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] proj/elfix:master commit in: misc/install.wrapper.c/
Date: Fri,  7 Feb 2014 18:10:01 +0000 (UTC)	[thread overview]
Message-ID: <1391792804.1ba1922f2a4a40357cdacf22ce3a418819acbf54.blueness@gentoo> (raw)

commit:     1ba1922f2a4a40357cdacf22ce3a418819acbf54
Author:     Gregory M. Turner <gmt <AT> be-evil <DOT> net>
AuthorDate: Fri Feb  7 17:06:44 2014 +0000
Commit:     Anthony G. Basile <blueness <AT> gentoo <DOT> org>
CommitDate: Fri Feb  7 17:06:44 2014 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/elfix.git;a=commit;h=1ba1922f

install.wrapper.c: correctly deal with args taking arguments

We can't rely on getopt_long returning '?' to skip arguments
that take a subsequent argument in short form.  This can result
in a miscalculation of "first".  For example,

  install-xattr -m 0555 foo bar

when bar is a directory will fail due to there being no file "0555"
without this change.

Signed-off-by: Anthony G. Basile <blueness <AT> gentoo.org>

---
 misc/install.wrapper.c/install.wrapper.c | 15 ++++++++++++++-
 1 file changed, 14 insertions(+), 1 deletion(-)

diff --git a/misc/install.wrapper.c/install.wrapper.c b/misc/install.wrapper.c/install.wrapper.c
index f0425f9..0f25520 100644
--- a/misc/install.wrapper.c/install.wrapper.c
+++ b/misc/install.wrapper.c/install.wrapper.c
@@ -252,18 +252,31 @@ main(int argc, char* argv[])
 		static struct option long_options[] = {
 			{           "directory",       no_argument, 0, 'd'},
 			{    "target-directory", required_argument, 0, 't'},
+			{               "group", required_argument, 0, 'g'},
+			{                "mode", required_argument, 0, 'm'},
+			{               "owner", required_argument, 0, 'o'},
+			{              "suffix", required_argument, 0, 'S'},
+			{             "context", optional_argument, 0, 'Z'},
+			{              "backup", optional_argument, 0, 'b'},
 			{                "help",       no_argument, 0,  0 },
 			{                     0,                 0, 0,  0 }
 		};
 
 		int option_index;
-		int c = getopt_long(argc, argv, "dt:", long_options, &option_index);
+		int c = getopt_long(argc, argv, "dt:g:m:o:S:Z:", long_options, &option_index);
+
  
 		if (c == -1)
 			break;
 
 		switch (c) {
 			case 0:
+			case 'g':
+			case 'm':
+			case 'o':
+			case 'S':
+			case 'Z':
+			case 'b':
 			case '?':
 				/* We skip the flags we don't care about */
 				break;


             reply	other threads:[~2014-02-07 18:10 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-02-07 18:10 Anthony G. Basile [this message]
  -- strict thread matches above, loose matches on Subject: below --
2014-02-07 18:10 [gentoo-commits] proj/elfix:master commit in: misc/install.wrapper.c/ Anthony G. Basile
2014-01-20 19:02 Anthony G. Basile
2014-01-18 23:39 Anthony G. Basile
2014-01-18 23:25 Anthony G. Basile
2014-01-18 20:57 Anthony G. Basile
2014-01-18 20:30 Anthony G. Basile
2014-01-18 20:23 Anthony G. Basile
2014-01-18 20:06 Anthony G. Basile
2014-01-18 13:18 Anthony G. Basile
2014-01-18 13:18 Anthony G. Basile

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=1391792804.1ba1922f2a4a40357cdacf22ce3a418819acbf54.blueness@gentoo \
    --to=blueness@gentoo.org \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /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