From: Howard Chu Date: Fri, 6 Nov 2009 02:20:40 +0000 (+0000) Subject: partially revert prev commit X-Git-Tag: ACLCHECK_0~141 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=9a65f35f2ef48377a046f17ae24732e9e1b0b367;p=openldap partially revert prev commit --- diff --git a/libraries/libldap/getdn.c b/libraries/libldap/getdn.c index fc52503400..540c2d2672 100644 --- a/libraries/libldap/getdn.c +++ b/libraries/libldap/getdn.c @@ -2133,13 +2133,12 @@ strval2str( struct berval *val, char *str, unsigned flags, ber_len_t *len ) * The length was checked in strval2strlen(); */ cl = LDAP_UTF8_CHARLEN( &val->bv_val[ s ] ); - + /* * there might be some chars we want to escape in form * of a couple of hexdigits for optimization purposes */ - if ( cl > 1 ) { - if ( !LDAP_DN_IS_PRETTY( flags ) + if ( ( cl > 1 && !LDAP_DN_IS_PRETTY( flags ) ) #ifdef PRETTY_ESCAPE #if 0 || LDAP_DN_WILLESCAPE_HEX( flags, val->bv_val[ s ] ) @@ -2154,17 +2153,16 @@ strval2str( struct berval *val, char *str, unsigned flags, ber_len_t *len ) #endif /* ! PRETTY_ESCAPE */ ) { - for ( ; cl--; ) { - str[ d++ ] = '\\'; - byte2hexpair( &val->bv_val[ s ], &str[ d ] ); - s++; - d += 2; - } + for ( ; cl--; ) { + str[ d++ ] = '\\'; + byte2hexpair( &val->bv_val[ s ], &str[ d ] ); + s++; + d += 2; + } - } else { - for ( ; cl--; ) { - str[ d++ ] = val->bv_val[ s++ ]; - } + } else if ( cl > 1 ) { + for ( ; cl--; ) { + str[ d++ ] = val->bv_val[ s++ ]; } } else {