summaryrefslogtreecommitdiff
path: root/lib-src
diff options
context:
space:
mode:
authorJan Djärv <jan.h.d@swipnet.se>2009-11-23 09:51:06 +0000
committerJan Djärv <jan.h.d@swipnet.se>2009-11-23 09:51:06 +0000
commit46f3381adef956e0e3d83e8950af6cba8420f9f5 (patch)
tree8f95e6ec42493f9b87a7dcf78a286401cd1e70f0 /lib-src
parent581e51e8918b3ba9b58e67768a1de39ce5f1cbd3 (diff)
downloademacs-46f3381adef956e0e3d83e8950af6cba8420f9f5.tar.gz
* etags.c (absolute_filename): Use memove if we have it for overlapping copy.
Diffstat (limited to 'lib-src')
-rw-r--r--lib-src/ChangeLog5
-rw-r--r--lib-src/etags.c11
2 files changed, 15 insertions, 1 deletions
diff --git a/lib-src/ChangeLog b/lib-src/ChangeLog
index b72d928dc6c..e4a1a3ea576 100644
--- a/lib-src/ChangeLog
+++ b/lib-src/ChangeLog
@@ -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'.
diff --git a/lib-src/etags.c b/lib-src/etags.c
index 0fbade822d5..6fce4529855 100644
--- a/lib-src/etags.c
+++ b/lib-src/etags.c
@@ -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;
}
}