aboutsummaryrefslogtreecommitdiffstats
path: root/missing/memmove.c
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2001-03-06 08:17:54 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2001-03-06 08:17:54 +0000
commita36e0c78c90917c4d5cc78f67b3808913795f264 (patch)
tree81deaaa0cacb33bd81163aac0a358755c85df2cd /missing/memmove.c
parent4a7d313e4a263f5c2f2f42dd573fa612f0d0c0a7 (diff)
downloadruby-a36e0c78c90917c4d5cc78f67b3808913795f264.tar.gz
* parse.y (primary): rescue and ensure clauses should be allowed
to appear in singleton method body. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1233 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'missing/memmove.c')
-rw-r--r--missing/memmove.c32
1 files changed, 14 insertions, 18 deletions
diff --git a/missing/memmove.c b/missing/memmove.c
index 09e64702b6..7961c5c0e6 100644
--- a/missing/memmove.c
+++ b/missing/memmove.c
@@ -1,24 +1,20 @@
-/*
- * memmove --- move memories.
- *
- * We supply this routine for those systems that aren't standard yet.
- */
+/* public domain rewrite of memcmp(3) */
char *
memmove (dst, src, n)
- char *dst, *src;
- int n;
+ char *dst, *src;
+ int n;
{
- char *ret = dst;
+ char *ret = dst;
- if (src < dst) {
- src += n;
- dst += n;
- while (n--)
- *--dst = *--src;
- }
- else if (dst < src)
- while (n--)
- *dst++ = *src++;
- return ret;
+ if (src < dst) {
+ src += n;
+ dst += n;
+ while (n--)
+ *--dst = *--src;
+ }
+ else if (dst < src)
+ while (n--)
+ *dst++ = *src++;
+ return ret;
}