# HG changeset patch # User Francesco Potort # Date 803736915 0 # Node ID 7e7941d8ccebc66e5290780b9b64447d5effd3e8 # Parent 91d4c394cb616123d82ea7c1fe285dc0c46b2a5a * etags.c (find_entries): rewind before rereading the input file. diff -r 91d4c394cb61 -r 7e7941d8cceb lib-src/etags.c --- a/lib-src/etags.c Tue Jun 20 22:17:03 1995 +0000 +++ b/lib-src/etags.c Wed Jun 21 12:15:15 1995 +0000 @@ -110,6 +110,13 @@ #define intoken(arg) (_itk[arg]) /* T if char can be in token */ #define endtoken(arg) (_etk[arg]) /* T if char ends tokens */ +#ifdef DOS_NT +# define absolutefn(fn) (fn[0] == '/' || (isalpha (fn[0]) && fn[1] == ':')) +#else +# define absolutefn(fn) (fn[0] == '/') +#endif + + /* * xnew -- allocate storage * @@ -392,7 +399,7 @@ { "cs", Cstar_entries }, { "hs", Cstar_entries }, - /* .f and .for are FORTRAN. */ + /* .F, .f and .for are FORTRAN. */ { "F", Fortran_functions }, { "f", Fortran_functions }, { "for", Fortran_functions }, @@ -1033,11 +1040,7 @@ { char *filename; -#ifdef DOS_NT - if (file[0] == '/' || (isalpha (file[0]) && file[1] == ':')) -#else - if (file[0] == '/') -#endif + if (absolutefn (file)) { /* file is an absolute filename. Canonicalise it. */ filename = absolute_filename (file, cwd); @@ -1131,7 +1134,10 @@ /* No Fortran entries found. Try C. */ if (old_last_node == last_node) - default_C_entries (inf); + { + rewind (inf); + default_C_entries (inf); + } fclose (inf); } @@ -3751,11 +3757,7 @@ { char *slashp, *cp, *res; -#ifdef DOS_NT - if (file[0] == '/' || (isalpha (file[0]) && file[1] == ':')) -#else - if (file[0] == '/') -#endif + if (absolutefn (file)) res = concat (file, "", ""); else res = concat (cwd, file, "");