aboutsummaryrefslogtreecommitdiff
path: root/contrib/texinfo/lib/memmove.c
diff options
context:
space:
mode:
authorMark Murray <markm@FreeBSD.org>1999-01-14 19:35:19 +0000
committerMark Murray <markm@FreeBSD.org>1999-01-14 19:35:19 +0000
commitd8b5c7ed06fe94e01ce1e61786c3e072de0c3e89 (patch)
tree570e5cf5730d6009252842b5ff3e1405c775afa0 /contrib/texinfo/lib/memmove.c
parent253c2b00b74a914f105a971446b873fc1f38919a (diff)
Upgrade texinfo to the latest-and-greatest.
This has big improvements to the .info file utility support and much recent OSS requires its features.
Notes
Notes: svn path=/vendor/texinfo/dist/; revision=42660
Diffstat (limited to 'contrib/texinfo/lib/memmove.c')
-rw-r--r--contrib/texinfo/lib/memmove.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/contrib/texinfo/lib/memmove.c b/contrib/texinfo/lib/memmove.c
new file mode 100644
index 000000000000..d7bdd7cd9950
--- /dev/null
+++ b/contrib/texinfo/lib/memmove.c
@@ -0,0 +1,24 @@
+/* memmove.c -- copy memory.
+ Copy LENGTH bytes from SOURCE to DEST. Does not null-terminate.
+ In the public domain.
+ By David MacKenzie <djm@gnu.ai.mit.edu>. */
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+void
+memmove (dest, source, length)
+ char *dest;
+ const char *source;
+ unsigned length;
+{
+ if (source < dest)
+ /* Moving from low mem to hi mem; start at end. */
+ for (source += length, dest += length; length; --length)
+ *--dest = *--source;
+ else if (source != dest)
+ /* Moving from hi mem to low mem; start at beginning. */
+ for (; length; --length)
+ *dest++ = *source++;
+}