summaryrefslogtreecommitdiff
path: root/misc/chattr.c
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 /misc/chattr.c
parentb34cbddbd66baedc163d36dd281b63ef478f547a (diff)
downloade2fsprogs-2293a4d5deb30b02d90c4d0aee516e8280092a58.tar.gz
chattr.c (main): Add support for '--' to stop options
processing. (Addresses Debian bug #225188).
Diffstat (limited to 'misc/chattr.c')
-rw-r--r--misc/chattr.c6
1 files changed, 5 insertions, 1 deletions
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++;