Conform to <draft-good-ldap-ldif-03.txt>; specifically,

a comment may be wrapped into several lines, and
values that end with a space should be base64 encoded.


git-svn-id: svn://10.0.0.236/branches/devel-branch-1_3@25898 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
kristian%netscape.com
1999-04-01 19:36:23 +00:00
parent 8329d2854a
commit f9a11dce24

View File

@@ -1,5 +1,5 @@
#############################################################################
# $Id: LDIF.pm,v 1.6.2.7 1999-03-22 18:05:33 kristian%netscape.com Exp $
# $Id: LDIF.pm,v 1.6.2.8 1999-04-01 19:36:23 kristian%netscape.com Exp $
#
# The contents of this file are subject to the Netscape Public License
# Version 1.0 (the "License"); you may not use this file except in
@@ -102,14 +102,9 @@ sub continue_line
sub unpack_LDIF
{
my ($str, $read_ref, $option) = @_;
if ((defined $option) and ("comments" eq lc $option)) {
# Move comments down to the end of a complete value:
while ($str =~ s"((^#.*$/)+)(( .*$/)+)"$3$1"m) {}
$str =~ s"((^#.*$/)+)( .*$)"$3$/$1"m;
} else {
$str =~ s"^#.*($/|$)""gm; # ignore comments
}
$str =~ s"$/ ""g; # combine continuation lines
$str =~ s"^#.*($/|$)""gm # ignore comments
unless ((defined $option) and ("comments" eq lc $option));
my (@record, $attr, $value);
local $_;
foreach $_ (split $/, $str) {
@@ -135,7 +130,7 @@ sub unpack_LDIF
return @record;
}
use vars qw($_std_encode); $_std_encode = "^[:< ]|[^ -\x7E]";
use vars qw($_std_encode); $_std_encode = '^[:< ]|[^ -\x7E]| $';
sub pack_LDIF
{