From 9cc46dc719566d4665f2e584cbd0b3b250d4b7d9 Mon Sep 17 00:00:00 2001 From: Gerrit Pape Date: Sat, 18 May 2002 17:30:16 +0000 Subject: * src/: include public domain sources to build byte.a, unix.a, time.a: runit builds without having daemontools' sources installed. 0.3.3. --- src/str_diff.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 src/str_diff.c (limited to 'src/str_diff.c') diff --git a/src/str_diff.c b/src/str_diff.c new file mode 100644 index 0000000..47dff22 --- /dev/null +++ b/src/str_diff.c @@ -0,0 +1,17 @@ +/* Public domain. */ + +#include "str.h" + +int str_diff(register const char *s,register const char *t) +{ + register char x; + + for (;;) { + x = *s; if (x != *t) break; if (!x) break; ++s; ++t; + x = *s; if (x != *t) break; if (!x) break; ++s; ++t; + x = *s; if (x != *t) break; if (!x) break; ++s; ++t; + x = *s; if (x != *t) break; if (!x) break; ++s; ++t; + } + return ((int)(unsigned int)(unsigned char) x) + - ((int)(unsigned int)(unsigned char) *t); +} -- cgit 1.4.1