while ( fgets( line, sizeof(line), fp ) != NULL ) {
int len = strlen( line );
- if( len < 2 ) {
+ if( len < 2 || ( len == 3 && *line == '\r' )) {
if( buf == NULL ) {
continue;
} else {
#define RIGHT2 0x03
#define RIGHT4 0x0f
-#define CONTINUED_LINE_MARKER '\001'
+#define CONTINUED_LINE_MARKER '\r'
#ifdef CSRIMALLOC
#define ber_memalloc malloc
line = *next;
while ( (*next = strchr( *next, '\n' )) != NULL ) {
- unsigned char c = *(*next + 1);
+ unsigned char c = (*next)[1];
+
+#if CONTINUED_LINE_MARKER != '\r'
+ if ( (*next)[-1] == '\r' ) {
+ (*next)[-1] = CONTINUED_LINE_MARKER;
+ }
+#endif
if ( !isspace( c ) || c == '\n' ) {
*(*next)++ = '\0';
}
**next = CONTINUED_LINE_MARKER;
- *(*next+1) = CONTINUED_LINE_MARKER;
+ (*next)[1] = CONTINUED_LINE_MARKER;
(*next)++;
}
} while( *line == '#' );