summaryrefslogtreecommitdiff
path: root/src/emacs.c
diff options
context:
space:
mode:
authorRichard M. Stallman <rms@gnu.org>1996-09-03 21:48:13 +0000
committerRichard M. Stallman <rms@gnu.org>1996-09-03 21:48:13 +0000
commit9f7f6e1210f6db64ce29e6cf21cd4acd97e28fa0 (patch)
tree36ad62f9672723e479e69446984230f9476f1671 /src/emacs.c
parentb8d09d59537dd41929a533d69f7bbb76e44bd100 (diff)
downloademacs-9f7f6e1210f6db64ce29e6cf21cd4acd97e28fa0.tar.gz
(sort_args): Don't rearrange any args that follow "--".
Diffstat (limited to 'src/emacs.c')
-rw-r--r--src/emacs.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/emacs.c b/src/emacs.c
index 57e581d142d..5d7dd7202f0 100644
--- a/src/emacs.c
+++ b/src/emacs.c
@@ -1114,6 +1114,7 @@ sort_args (argc, argv)
int to = 1;
int from;
int i;
+ int end_of_options = argc;
/* Categorize all the options,
and figure out which argv elts are option arguments. */
@@ -1126,6 +1127,19 @@ sort_args (argc, argv)
int match, thislen;
char *equals;
+ /* If we have found "--", don't consider
+ any more arguments as options. */
+ if (argv[from][1] == '-')
+ {
+ /* Leave the "--", and everything following it, at the end. */
+ for (; from < argc; from++)
+ {
+ priority[from] = -100;
+ options[from] = -1;
+ }
+ break;
+ }
+
/* Look for a match with a known old-fashioned option. */
for (i = 0; i < sizeof (standard_args) / sizeof (standard_args[0]); i++)
if (!strcmp (argv[from], standard_args[i].name))