[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: `etags' bug?
From: |
Andreas Schwab |
Subject: |
Re: `etags' bug? |
Date: |
Wed, 15 Dec 2004 14:19:59 +0100 |
User-agent: |
Gnus/5.110002 (No Gnus v0.2) Emacs/21.3.50 (gnu/linux) |
Paul Pogonyshev <address@hidden> writes:
> I tried a little debugging and I don't understand how the behaviour could
> be as documented. Function main() basically looks like this:
>
> while ((opt = getopt_long (...)) != EOF)
> switch (opt)
> {
> /* store `--language' and `--regex' arguments in `argbuffer' */
And file names as they are encountered between options. Starting
optstring with '-' causes getopt to not reorder arguments:
* If the OPTIONS argument string begins with a hyphen (`-'),
this is treated specially. It permits arguments that are not
options to be returned as if they were associated with option
character `\1'.
> }
>
> for (; optind < argc; optind++)
> {
> /* store filenames in `argbuffer' */
Only file names occuring after the last option.
So far for the theory. Unfortunately a typo during the conversion of
LONG_OPTIONS from a preprocessing to a compile time constant has broken
this. I've installed this patch to fix this:
2004-12-15 Andreas Schwab <address@hidden>
* etags.c (main): Fix typo in conversion of LONG_OPTIONS from
preprocessing to compile time constant.
--- etags.c 17 Nov 2004 10:37:38 +0100 3.43
+++ etags.c 15 Dec 2004 14:13:03 +0100
@@ -1,5 +1,5 @@
/* Tags file maker to go with GNU Emacs -*- coding: latin-1 -*-
- Copyright (C) 1984, 1987-1989, 1993-1995, 1998-2001, 2002
+ Copyright (C) 1984, 1987-1989, 1993-1995, 1998-2001, 2002, 2004
Free Software Foundation, Inc. and Ken Arnold
This file is not considered part of GNU Emacs.
@@ -1183,7 +1183,7 @@ main (argc, argv)
#ifdef ETAGS_REGEXPS
optstring = "-r:Rc:";
#endif /* ETAGS_REGEXPS */
- if (LONG_OPTIONS)
+ if (!LONG_OPTIONS)
optstring += 1;
optstring = concat (optstring,
"Cf:Il:o:SVhH",
Andreas.
--
Andreas Schwab, SuSE Labs, address@hidden
SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany
Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5
"And now for something completely different."