summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTheodore Ts'o <tytso@mit.edu>2004-01-20 13:39:01 -0500
committerTheodore Ts'o <tytso@mit.edu>2004-01-20 13:39:01 -0500
commit2293a4d5deb30b02d90c4d0aee516e8280092a58 (patch)
treeef16c084c57cdb77cb646ffd4f96c5cbc6c35858
parentb34cbddbd66baedc163d36dd281b63ef478f547a (diff)
downloade2fsprogs-2293a4d5deb30b02d90c4d0aee516e8280092a58.tar.gz
chattr.c (main): Add support for '--' to stop options
processing. (Addresses Debian bug #225188).
-rw-r--r--misc/ChangeLog5
-rw-r--r--misc/chattr.c6
2 files changed, 10 insertions, 1 deletions
diff --git a/misc/ChangeLog b/misc/ChangeLog
index 652f3da5..e6d60868 100644
--- a/misc/ChangeLog
+++ b/misc/ChangeLog
@@ -1,3 +1,8 @@
+2004-01-20 root <tytso@mit.edu>
+
+ * chattr.c (main): Add support for '--' to stop options
+ processing. (Addresses Debian bug #225188).
+
2003-12-26 Theodore Ts'o <tytso@mit.edu>
* chattr.1.in: Update text indicating the 'c', 's', and 'u'
diff --git a/misc/chattr.c b/misc/chattr.c
index b4b1ca3b..bb968646 100644
--- a/misc/chattr.c
+++ b/misc/chattr.c
@@ -276,7 +276,11 @@ int main (int argc, char ** argv)
program_name = *argv;
i = 1;
while (i < argc && !end_arg) {
- if (decode_arg (&i, argc, argv) == EOF)
+ /* '--' arg should end option processing */
+ if (strcmp(argv[i], "--") == 0) {
+ i++;
+ end_arg = 1;
+ } else if (decode_arg (&i, argc, argv) == EOF)
end_arg = 1;
else
i++;