]> code.delx.au - gnu-emacs/blobdiff - lib-src/etags.c
Close bug#3992.
[gnu-emacs] / lib-src / etags.c
index 0c2c9b949d0102969fc28795af0e23d02d5056c9..17aad9a225296e96be2d113d91e5c0870073f5de 100644 (file)
@@ -29,7 +29,7 @@ IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
 
 Copyright (C) 1984, 1987, 1988, 1989, 1993, 1994, 1995, 1998, 1999,
-  2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
+  2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
   Free Software Foundation, Inc.
 
 This file is not considered part of GNU Emacs.
@@ -898,7 +898,7 @@ static void
 print_version ()
 {
   /* Makes it easier to update automatically. */
-  char emacs_copyright[] = "Copyright (C) 2008 Free Software Foundation, Inc.";
+  char emacs_copyright[] = "Copyright (C) 2010 Free Software Foundation, Inc.";
 
   printf ("%s (%s %s)\n", (CTAGS) ? "ctags" : "etags", EMACS_NAME, VERSION);
   puts (emacs_copyright);
@@ -4108,6 +4108,10 @@ Fortran_functions (inf)
       dbp = skip_spaces (dbp);
       if (*dbp == '\0')
        continue;
+
+      if (LOOKING_AT_NOCASE (dbp, "recursive"))
+       dbp = skip_spaces (dbp);
+
       switch (lowcase (*dbp))
        {
        case 'i':
@@ -5000,8 +5004,9 @@ Scheme_functions (inf)
       if (strneq (bp, "(def", 4) || strneq (bp, "(DEF", 4))
        {
          bp = skip_non_spaces (bp+4);
-         /* Skip over open parens and white space */
-         while (notinname (*bp))
+         /* Skip over open parens and white space.  Don't continue past
+            '\0'. */
+         while (*bp && notinname (*bp))
            bp++;
          get_tag (bp, NULL);
        }
@@ -5881,7 +5886,7 @@ add_regex (regexp_pattern, lang)
   else
     re_set_syntax (RE_SYNTAX_EMACS);
 
-  err = re_compile_pattern (pat, strlen (regexp_pattern), patbuf);
+  err = re_compile_pattern (pat, strlen (pat), patbuf);
   if (multi_line)
     free (pat);
   if (err != NULL)
@@ -6297,7 +6302,7 @@ readline (lbp, stream)
                  readline (lbp, stream);
                  return;
                } /* if a real #line directive */
-           } /* if #line is followed by a number */
+           } /* if #line is followed by a number */
        } /* if line begins with "#line " */
 
       /* If we are here, no #line directive was found. */
@@ -6695,13 +6700,22 @@ absolute_filename (file, dir)
              else if (cp[0] != '/')
                cp = slashp;
 #endif
+#ifdef HAVE_MEMMOVE
+              memmove (cp, slashp + 3, strlen (slashp + 2));
+#else
+              /* Overlapping copy isn't really okay */
              strcpy (cp, slashp + 3);
+#endif
              slashp = cp;
              continue;
            }
          else if (slashp[2] == '/' || slashp[2] == '\0')
            {
-             strcpy (slashp, slashp + 2);
+#ifdef HAVE_MEMMOVE
+             memmove (slashp, slashp + 2, strlen (slashp + 1));
+#else
+              strcpy (slashp, slashp + 2);
+#endif
              continue;
            }
        }