From 2293a4d5deb30b02d90c4d0aee516e8280092a58 Mon Sep 17 00:00:00 2001 From: Theodore Ts'o Date: Tue, 20 Jan 2004 13:39:01 -0500 Subject: chattr.c (main): Add support for '--' to stop options processing. (Addresses Debian bug #225188). --- misc/chattr.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'misc/chattr.c') 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++; -- cgit v1.2.3