From 708aaada82e3af7abe85d559342c638dd7939b85 Mon Sep 17 00:00:00 2001 From: Stef Walter Date: Wed, 25 Aug 2004 23:41:24 +0000 Subject: Fixed problem with checking when complete --- lib/rlib.c | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/rlib.c b/lib/rlib.c index faca2b8..38e8268 100644 --- a/lib/rlib.c +++ b/lib/rlib.c @@ -239,7 +239,7 @@ int rlibRun(r_stream* stream, r_script* script, int done) * After this the search could start anew * unless in flush mode or done */ - if(done == true) + if(done) RETURN(R_DONE); else RETURN(R_IN); @@ -455,6 +455,28 @@ int repInit(r_context* ctx) return R_OK; } +#ifdef _DEBUG +static void* memstr(void* mem, size_t sz, const char* str) +{ + size_t len = strlen(str); + const char* t; + const char* e; + + ASSERT(str && mem); + + if(len > sz) + return NULL; + + for(t = (const char*)mem, e = t + (sz - len); t < e; t++) + { + if(memcmp(t, str, len) == 0) + return (void*)t; + } + + return NULL; +} +#endif + int repFile(r_context* ctx, FILE* fIn) { r_uint batch; /* Current batch size */ -- cgit v1.2.3