The code below leads to an endless loop. It works fine with the original Oniguruma, but not with the Ruby modifications downloaded from SVN today.

The expected result is 1, resulting from char 'a' plus a '\0' terminator, both passed in UTF-16LE.

Ralf

-----------

#include <alloc.h>
#include <mem.h>
#include <stdio.h>

#include "ruby\oniguruma.h"

ONIG_EXTERN OnigEncodingType OnigEncodingUTF_16LE;

int main(int argc, char* argv[])
{
 char * p = malloc (16);
 int l;

 p[0] = '\0';
 p[1] = 'a';
 p[2] = '\0';
 p[3] = '\0';

 /* Endless loop on next line: */
 l = onigenc_strlen_null (&OnigEncodingUTF_16LE, p);

 printf ("%d", l);

 free (p);
 return 0;
}