From: Jim Meyering Date: Sun, 24 Oct 2010 16:00:57 +0000 (-0400) Subject: * emacs.c (argmatch): Don't treat "--" as "--chdir". X-Git-Tag: emacs-pretest-24.0.90~104^2~275^2~438^2~45^2~484 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=947f5e0162195e6503ca8e769f113f310cde6deb;p=emacs.git * emacs.c (argmatch): Don't treat "--" as "--chdir". --- 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