changeset 106202:6a5f884264d9

* etags.c (absolute_filename): Use memove if we have it for overlapping copy.
author Jan Djärv <jan.h.d@swipnet.se>
date Mon, 23 Nov 2009 09:51:06 +0000
parents 01190029e5d3
children d51db5b86079
files lib-src/ChangeLog lib-src/etags.c
diffstat 2 files changed, 15 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/lib-src/ChangeLog	Mon Nov 23 08:55:08 2009 +0000
+++ b/lib-src/ChangeLog	Mon Nov 23 09:51:06 2009 +0000
@@ -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'.
--- a/lib-src/etags.c	Mon Nov 23 08:55:08 2009 +0000
+++ b/lib-src/etags.c	Mon Nov 23 09:51:06 2009 +0000
@@ -6695,13 +6695,22 @@
 	      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;
 	    }
 	}