Using 1.6.4 in the simplest way C language on IRIX platform I discovered a bug causing segmentation violation. It boils down to this test example, where <blank> is used for clarity instead of actual whitespace:
field:value\
%%
field: value\
<blank>
%%
The file consists of two records, each with one field. The first field is OK, the value ending with a backslash, newline and a newline. The second field causes trouble, ending with a backslash, newline, blank and newline. Looking around in orjapi.c, I discovered that the
process_field_markers() routine returns the 'numFields' value incorrectly for this input. It returns 1 instead of 2. This cause the alloc to allocate too little memory when 'cbFields' is used. In some environments this will cause a failure.
The internal error inside process_field_markers() is caused by a lack of the second "++*numFields;" execution. This in turn is caused by the if-test failing due to "0 == numInitialWsToSkip" test. You must take it from there.
Regards,
henrik.johansson@saabgroup.com (work)
h.johansson.stockholm@telia.com (home)