diff options
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 */ |