#define RIGHT4 0x0f
#define CONTINUED_LINE_MARKER '\001'
-static const char nib2b64[0x40f] =
+static const char nib2b64[0x40] =
"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
static const unsigned char b642nib[0x80] = {
char *
ldif_getline( char **next )
{
- char *l;
+ char *line;
- if ( *next == NULL || **next == '\n' || **next == '\0' ) {
- return( NULL );
- }
+ do {
+ if ( *next == NULL || **next == '\n' || **next == '\0' ) {
+ return( NULL );
+ }
+
+ line = *next;
- l = *next;
- while ( (*next = strchr( *next, '\n' )) != NULL ) {
- unsigned char c = *(*next + 1);
- if ( isspace( c ) && c != '\n' ) {
- **next = CONTINUED_LINE_MARKER;
- *(*next+1) = CONTINUED_LINE_MARKER;
- } else {
- *(*next)++ = '\0';
- break;
+ while ( (*next = strchr( *next, '\n' )) != NULL ) {
+ unsigned char c = *(*next + 1);
+ if ( isspace( c ) && c != '\n' ) {
+ **next = CONTINUED_LINE_MARKER;
+ *(*next+1) = CONTINUED_LINE_MARKER;
+ } else {
+ *(*next)++ = '\0';
+ break;
+ }
+ (*next)++;
}
- (*next)++;
- }
+ } while( *line == '#' );
- return( l );
+ return( line );
}
void