diff options
author | Karoly Lorentey <lorentey@elte.hu> | 2006-10-14 16:56:21 +0000 |
---|---|---|
committer | Karoly Lorentey <lorentey@elte.hu> | 2006-10-14 16:56:21 +0000 |
commit | 3f87f67ee215ffeecbd2f53bd7f342cdf03f47df (patch) | |
tree | 16f2af9111af08a94d608d96a957f5c3ec5effcc /lib-src | |
parent | 350e4fb815d7413ef6d339dd664014706f742927 (diff) | |
parent | 7a210b69c7f92650c524766d1b9d3f3eefdd67c7 (diff) | |
download | emacs-3f87f67ee215ffeecbd2f53bd7f342cdf03f47df.tar.gz |
Merged from emacs@sv.gnu.org
Patches applied:
* emacs@sv.gnu.org/emacs--devo--0--patch-371
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-372
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-373
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-374
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-375
Merge from gnus--rel--5.10
* emacs@sv.gnu.org/emacs--devo--0--patch-376
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-377
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-378
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-379
Merge from erc--emacs--21
* emacs@sv.gnu.org/emacs--devo--0--patch-380
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-381
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-382
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-383
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-384
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-385
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-386
Update from erc--emacs--22
* emacs@sv.gnu.org/emacs--devo--0--patch-387
Fix ERC bug introduced in last patch
* emacs@sv.gnu.org/emacs--devo--0--patch-388
Update from erc--emacs--22
* emacs@sv.gnu.org/emacs--devo--0--patch-389
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-390
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-391
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-392
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-393
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-394
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-395
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-396
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-397
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-398
Merge from gnus--rel--5.10
* emacs@sv.gnu.org/emacs--devo--0--patch-399
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-400
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-401
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-402
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-403
Rcirc update from Ryan Yeske
* emacs@sv.gnu.org/emacs--devo--0--patch-404
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-405
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-406
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-407
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-408
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-409
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-410
Merge from gnus--rel--5.10
* emacs@sv.gnu.org/emacs--devo--0--patch-411
Miscellaneous tq-related fixes.
* emacs@sv.gnu.org/emacs--devo--0--patch-412
Update from CVS
* emacs@sv.gnu.org/gnus--rel--5.10--patch-121
Update from CVS
* emacs@sv.gnu.org/gnus--rel--5.10--patch-122
Update from CVS
* emacs@sv.gnu.org/gnus--rel--5.10--patch-123
Update from CVS
* emacs@sv.gnu.org/gnus--rel--5.10--patch-124
Update from CVS
* emacs@sv.gnu.org/gnus--rel--5.10--patch-125
Update from CVS
* emacs@sv.gnu.org/gnus--rel--5.10--patch-126
Merge from emacs--devo--0
* emacs@sv.gnu.org/gnus--rel--5.10--patch-127
Update from CVS
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-581
Diffstat (limited to 'lib-src')
-rw-r--r-- | lib-src/ChangeLog | 26 | ||||
-rw-r--r-- | lib-src/etags.c | 96 |
2 files changed, 55 insertions, 67 deletions
diff --git a/lib-src/ChangeLog b/lib-src/ChangeLog index 6be0910d27a..3328f010846 100644 --- a/lib-src/ChangeLog +++ b/lib-src/ChangeLog @@ -1,3 +1,29 @@ +2006-08-09 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> + + * etags.c (readline): expect sscanf returns >= 1. + (readline): Change position on %n and \" in sscanf. + +2006-08-07 Masatake YAMATO <jet@gyve.org> + + * etags.c (readline): expect sscanf returns 2, + not 1. + +2006-08-07 Masatake YAMATO <jet@gyve.org> + + * etags.c (TEX_mode): Check getc retruns EOF. + File ended without newline causes infinite loop. + +2002-07-30 Adrian Aichner <adrian@xemacs.org> (tiny change) + + * etags.c: It's XEmacs, not Xemacs: change all the occurences. + +2006-07-30 Francesco Potort,Al(B <pot@gnu.org> + + * etags.c [ETAGS_REGEXPS]: Now is unconditionally defined. + [LONG_OPTIONS]: Changed to NO_LONG_OPTIONS, which is undefined. + (Objc_suffixes): Suggest using --lang=c for full help. + (C_entries): Initialise savetoken to 0 to shut up the compiler. + 2006-07-20 Andreas Schwab <schwab@suse.de> * fakemail.c (fatal): Drop second parameter and treat first diff --git a/lib-src/etags.c b/lib-src/etags.c index b5ff33c8b4c..49a18be1df5 100644 --- a/lib-src/etags.c +++ b/lib-src/etags.c @@ -41,7 +41,7 @@ * configuration file containing regexp definitions for etags. */ -char pot_etags_version[] = "@(#) pot revision number is 17.18"; +char pot_etags_version[] = "@(#) pot revision number is 17.20"; #define TRUE 1 #define FALSE 0 @@ -59,12 +59,10 @@ char pot_etags_version[] = "@(#) pot revision number is 17.18"; /* On some systems, Emacs defines static as nothing for the sake of unexec. We don't want that here since we don't use unexec. */ # undef static -# define ETAGS_REGEXPS /* use the regexp features */ -# define LONG_OPTIONS /* accept long options */ -# ifndef PTR /* for Xemacs */ +# ifndef PTR /* for XEmacs */ # define PTR void * # endif -# ifndef __P /* for Xemacs */ +# ifndef __P /* for XEmacs */ # define __P(args) args # endif #else /* no config.h */ @@ -82,14 +80,7 @@ char pot_etags_version[] = "@(#) pot revision number is 17.18"; # define _GNU_SOURCE 1 /* enables some compiler checks on GNU */ #endif -#ifdef LONG_OPTIONS -# undef LONG_OPTIONS -# define LONG_OPTIONS TRUE -#else -# define LONG_OPTIONS FALSE -#endif - -/* WIN32_NATIVE is for Xemacs. +/* WIN32_NATIVE is for XEmacs. MSDOS, WINDOWSNT, DOS_NT are for Emacs. */ #ifdef WIN32_NATIVE # undef MSDOS @@ -167,25 +158,25 @@ char pot_etags_version[] = "@(#) pot revision number is 17.18"; # define S_ISREG(m) (((m) & S_IFMT) == S_IFREG) #endif -#if LONG_OPTIONS -# include <getopt.h> -#else +#ifdef NO_LONG_OPTIONS /* define this if you don't have GNU getopt */ +# define NO_LONG_OPTIONS TRUE # define getopt_long(argc,argv,optstr,lopts,lind) getopt (argc, argv, optstr) extern char *optarg; extern int optind, opterr; -#endif /* LONG_OPTIONS */ +#else +# define NO_LONG_OPTIONS FALSE +# include <getopt.h> +#endif /* NO_LONG_OPTIONS */ -#ifdef ETAGS_REGEXPS -# ifndef HAVE_CONFIG_H /* this is a standalone compilation */ -# ifdef __CYGWIN__ /* compiling on Cygwin */ +#ifndef HAVE_CONFIG_H /* this is a standalone compilation */ +# ifdef __CYGWIN__ /* compiling on Cygwin */ !!! NOTICE !!! the regex.h distributed with Cygwin is not compatible with etags, alas! If you want regular expression support, you should delete this notice and arrange to use the GNU regex.h and regex.c. -# endif # endif -# include <regex.h> -#endif /* ETAGS_REGEXPS */ +#endif +#include <regex.h> /* Define CTAGS to make the program "ctags" compatible with the usual one. Leave it undefined to make the program "etags", which makes emacs-style @@ -312,7 +303,6 @@ typedef struct char *what; /* the argument itself */ } argument; -#ifdef ETAGS_REGEXPS /* Structure defining a regular expression. */ typedef struct regexp { @@ -327,7 +317,6 @@ typedef struct regexp bool ignore_case; /* ignore case when matching */ bool multi_line; /* do a multi-line match on the whole file */ } regexp; -#endif /* ETAGS_REGEXPS */ /* Many compilers barf on this: @@ -375,11 +364,9 @@ static long readline_internal __P((linebuffer *, FILE *)); static bool nocase_tail __P((char *)); static void get_tag __P((char *, char **)); -#ifdef ETAGS_REGEXPS static void analyse_regex __P((char *)); static void free_regexps __P((void)); static void regex_tag_multiline __P((void)); -#endif /* ETAGS_REGEXPS */ static void error __P((const char *, const char *)); static void suggest_asking_for_help __P((void)); void fatal __P((char *, char *)); @@ -485,14 +472,9 @@ static bool packages_only; /* --packages-only: in Ada, only tag packages*/ #define STDIN 0x1001 /* returned by getopt_long on --parse-stdin */ static bool parsing_stdin; /* --parse-stdin used */ -#ifdef ETAGS_REGEXPS static regexp *p_head; /* list of all regexps */ static bool need_filebuf; /* some regexes are multi-line */ -#else -# define need_filebuf FALSE -#endif /* ETAGS_REGEXPS */ -#if LONG_OPTIONS static struct option longopts[] = { { "append", no_argument, NULL, 'a' }, @@ -507,11 +489,9 @@ static struct option longopts[] = { "members", no_argument, &members, TRUE }, { "no-members", no_argument, &members, FALSE }, { "output", required_argument, NULL, 'o' }, -#ifdef ETAGS_REGEXPS { "regex", required_argument, NULL, 'r' }, { "no-regex", no_argument, NULL, 'R' }, { "ignore-case-regex", required_argument, NULL, 'c' }, -#endif /* ETAGS_REGEXPS */ { "parse-stdin", required_argument, NULL, STDIN }, { "version", no_argument, NULL, 'V' }, @@ -533,7 +513,6 @@ static struct option longopts[] = #endif { NULL } }; -#endif /* LONG_OPTIONS */ static compressor compressors[] = { @@ -681,13 +660,15 @@ static char *Objc_suffixes [] = static char Objc_help [] = "In Objective C code, tags include Objective C definitions for classes,\n\ class categories, methods and protocols. Tags for variables and\n\ -functions in classes are named `CLASS::VARIABLE' and `CLASS::FUNCTION'."; +functions in classes are named `CLASS::VARIABLE' and `CLASS::FUNCTION'.\n\ +(Use --help --lang=c --lang=objc --lang=java for full help.)"; static char *Pascal_suffixes [] = { "p", "pas", NULL }; static char Pascal_help [] = "In Pascal code, the tags are the functions and procedures defined\n\ in the file."; +/* " // this is for working around an Emacs highlighting bug... */ static char *Perl_suffixes [] = { "pl", "pm", NULL }; @@ -885,11 +866,11 @@ print_help (argbuffer) printf ("Usage: %s [options] [[regex-option ...] file-name] ...\n\ \n\ These are the options accepted by %s.\n", progname, progname); - if (LONG_OPTIONS) - puts ("You may use unambiguous abbreviations for the long option names."); + if (NO_LONG_OPTIONS) + puts ("WARNING: long option names do not work with this executable,\n\ +as it is not linked with GNU getopt."); else - puts ("Long option names do not work with this executable, as it is not\n\ -linked with GNU getopt."); + puts ("You may use unambiguous abbreviations for the long option names."); puts (" A - as file name means read names from stdin (one per line).\n\ Absolute names are stored in the output file as they are.\n\ Relative ones are stored relative to the output file's directory.\n"); @@ -949,7 +930,6 @@ Relative ones are stored relative to the output file's directory.\n"); puts ("--members\n\ Create tag entries for members of structures in some languages."); -#ifdef ETAGS_REGEXPS puts ("-r REGEXP, --regex=REGEXP or --regex=@regexfile\n\ Make a tag for each line matching a regular expression pattern\n\ in the following files. {LANGUAGE}REGEXP uses REGEXP for LANGUAGE\n\ @@ -964,7 +944,6 @@ Relative ones are stored relative to the output file's directory.\n"); causes dot to match any character, including newline."); puts ("-R, --no-regex\n\ Don't create tags from regexps for the following files."); -#endif /* ETAGS_REGEXPS */ puts ("-I, --ignore-indentation\n\ In C and C++ do not assume that a closing brace in the first\n\ column is the final brace of a function or structure definition."); @@ -1194,14 +1173,8 @@ main (argc, argv) /* When the optstring begins with a '-' getopt_long does not rearrange the non-options arguments to be at the end, but leaves them alone. */ - optstring = "-"; -#ifdef ETAGS_REGEXPS - optstring = "-r:Rc:"; -#endif /* ETAGS_REGEXPS */ - if (!LONG_OPTIONS) - optstring += 1; /* remove the initial '-' */ - optstring = concat (optstring, - "aCf:Il:o:SVhH", + optstring = concat (NO_LONG_OPTIONS ? "" : "-", + "ac:Cf:Il:o:r:RSVhH", (CTAGS) ? "BxdtTuvw" : "Di:"); while ((opt = getopt_long (argc, argv, optstring, longopts, NULL)) != EOF) @@ -1375,11 +1348,9 @@ main (argc, argv) case at_language: lang = argbuffer[i].lang; break; -#ifdef ETAGS_REGEXPS case at_regexp: analyse_regex (argbuffer[i].what); break; -#endif case at_filename: #ifdef VMS while ((this_file = gfnames (argbuffer[i].what, &got_err)) != NULL) @@ -1419,9 +1390,7 @@ main (argc, argv) } } -#ifdef ETAGS_REGEXPS free_regexps (); -#endif /* ETAGS_REGEXPS */ free (lb.buffer); free (filebuf.buffer); free (token_name.buffer); @@ -1979,9 +1948,7 @@ find_entries (inf) parser (inf); -#ifdef ETAGS_REGEXPS regex_tag_multiline (); -#endif /* ETAGS_REGEXPS */ } @@ -3239,7 +3206,7 @@ C_entries (c_ext, inf) int typdefbracelev; /* bracelev where a typedef struct body begun */ bool incomm, inquote, inchar, quotednl, midtoken; bool yacc_rules; /* in the rules part of a yacc file */ - struct tok savetoken; /* token saved during preprocessor handling */ + struct tok savetoken = {0}; /* token saved during preprocessor handling */ linebuffer_init (&lbs[0].lb); @@ -5198,7 +5165,7 @@ TEX_mode (inf) { /* Skip to next line if we hit the TeX comment char. */ if (c == '%') - while (c != '\n') + while (c != '\n' && c != EOF) c = getc (inf); else if (c == TEX_LESC || c == TEX_SESC ) break; @@ -5735,8 +5702,6 @@ erlang_atom (s) } -#ifdef ETAGS_REGEXPS - static char *scan_separators __P((char *)); static void add_regex __P((char *, language *)); static char *substitute __P((char *, char *, struct re_registers *)); @@ -6141,8 +6106,6 @@ regex_tag_multiline () } } -#endif /* ETAGS_REGEXPS */ - static bool nocase_tail (cp) @@ -6296,9 +6259,10 @@ readline (lbp, stream) int start, lno; if (DEBUG) start = 0; /* shut up the compiler */ - if (sscanf (lbp->buffer, "#line %d \"%n", &lno, &start) == 1) + if (sscanf (lbp->buffer, "#line %d %n\"", &lno, &start) >= 1 + && lbp->buffer[start] == '"') { - char *endp = lbp->buffer + start; + char *endp = lbp->buffer + ++start; assert (start > 0); while ((endp = etags_strchr (endp, '"')) != NULL @@ -6405,7 +6369,6 @@ readline (lbp, stream) } } /* if #line directives should be considered */ -#ifdef ETAGS_REGEXPS { int match; regexp *rp; @@ -6462,7 +6425,6 @@ readline (lbp, stream) } } } -#endif /* ETAGS_REGEXPS */ } @@ -6623,7 +6585,7 @@ static void suggest_asking_for_help () { fprintf (stderr, "\tTry `%s %s' for a complete list of options.\n", - progname, LONG_OPTIONS ? "--help" : "-h"); + progname, NO_LONG_OPTIONS ? "-h" : "--help"); exit (EXIT_FAILURE); } |