From 947f5e0162195e6503ca8e769f113f310cde6deb Mon Sep 17 00:00:00 2001 From: Jim Meyering Date: Sun, 24 Oct 2010 12:00:57 -0400 Subject: [PATCH] * emacs.c (argmatch): Don't treat "--" as "--chdir". --- src/ChangeLog | 4 ++++ src/emacs.c | 15 ++++++++------- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index 755a35a2713..4c7711e34b9 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,7 @@ +2010-10-24 Jim Meyering + + * emacs.c (argmatch): Don't treat "--" as "--chdir". + 2010-10-24 Glenn Morris * w16select.c (syms_of_win16select) : diff --git a/src/emacs.c b/src/emacs.c index 70a0fae4ebf..e83725ccf03 100644 --- a/src/emacs.c +++ b/src/emacs.c @@ -829,13 +829,14 @@ main (int argc, char **argv) printf ("see the file named COPYING.\n"); exit (0); } - if (argmatch (argv, argc, "-chdir", "--chdir", 2, &ch_to_dir, &skip_args)) - if (chdir (ch_to_dir) == -1) - { - fprintf (stderr, "%s: Can't chdir to %s: %s\n", - argv[0], ch_to_dir, strerror (errno)); - exit (1); - } + + if (argmatch (argv, argc, "-chdir", "--chdir", 4, &ch_to_dir, &skip_args)) + if (chdir (ch_to_dir) == -1) + { + fprintf (stderr, "%s: Can't chdir to %s: %s\n", + argv[0], ch_to_dir, strerror (errno)); + exit (1); + } #ifdef HAVE_PERSONALITY_LINUX32 -- 2.39.5