diff options
author | Stef Walter <stef@thewalter.net> | 2004-08-25 23:41:24 +0000 |
---|---|---|
committer | Stef Walter <stef@thewalter.net> | 2004-08-25 23:41:24 +0000 |
commit | 708aaada82e3af7abe85d559342c638dd7939b85 (patch) | |
tree | 116098bb3de1b742f761d28f00d360bf08f79a82 /lib/rlib.c | |
parent | 6c835a8ebc590caebc4979fb7dcb223673a3ec85 (diff) |
Fixed problem with checking when complete
Diffstat (limited to 'lib/rlib.c')
-rw-r--r-- | lib/rlib.c | 24 |
1 files changed, 23 insertions, 1 deletions
@@ -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 */ |