unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Andreas Schwab <schwab@suse.de>
Cc: Francesco Potorti` <pot@gnu.org>, emacs-devel@gnu.org
Subject: Re: `etags' bug?
Date: Wed, 15 Dec 2004 14:19:59 +0100	[thread overview]
Message-ID: <je7jnjn1fk.fsf@sykes.suse.de> (raw)
In-Reply-To: <200412150457.32970.pogonyshev@gmx.net> (Paul Pogonyshev's message of "Wed, 15 Dec 2004 04:57:32 +0200")

Paul Pogonyshev <pogonyshev@gmx.net> 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  <schwab@suse.de>

	* 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, schwab@suse.de
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."

  reply	other threads:[~2004-12-15 13:19 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-12-09 18:15 `etags' bug? Paul Pogonyshev
2004-12-14 10:53 ` Francesco Potorti`
2004-12-15  2:57   ` Paul Pogonyshev
2004-12-15 13:19     ` Andreas Schwab [this message]
2004-12-15 13:46       ` Francesco Potorti`
2004-12-15 15:45         ` Paul Pogonyshev

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=je7jnjn1fk.fsf@sykes.suse.de \
    --to=schwab@suse.de \
    --cc=emacs-devel@gnu.org \
    --cc=pot@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).