]> git.eshelyaron.com Git - emacs.git/commitdiff
* etags.c (absolute_filename): Use memove if we have it for overlapping copy.
authorJan Djärv <jan.h.d@swipnet.se>
Mon, 23 Nov 2009 09:51:06 +0000 (09:51 +0000)
committerJan Djärv <jan.h.d@swipnet.se>
Mon, 23 Nov 2009 09:51:06 +0000 (09:51 +0000)
lib-src/ChangeLog
lib-src/etags.c

index b72d928dc6cf21bbeafac1c350b383ff3bc253ed..e4a1a3ea576b44f09784a3fe24ea7af64e8cb39c 100644 (file)
@@ -1,3 +1,8 @@
+2009-11-23  Tobias Ringström  <tobias@ringis.se> (tiny change)
+
+       * etags.c (absolute_filename): Use memove if we have it for
+       overlapping copy.
+
 2009-11-04  Dan Nicolaescu  <dann@ics.uci.edu>
 
        * make-docfile.c (scan_lisp_file): Also look for `defvaralias'.
index 0fbade822d5d3e4495123a84be11ad7c36fc8b0c..6fce4529855f0536859d021281a485f93d246889 100644 (file)
@@ -6695,13 +6695,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;
            }
        }