Skip to content

Commit

Permalink
prepare for allowing to write mixed LDIFs (i.e. some entries with
Browse files Browse the repository at this point in the history
changetype, others without)
  • Loading branch information
marschap committed Jun 10, 2004
1 parent f4e1f9d commit ba08c63
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions lib/Net/LDAP/LDIF.pm
Expand Up @@ -9,7 +9,7 @@ use SelectSaver;
require Net::LDAP::Entry;
use vars qw($VERSION);

$VERSION = "0.14_02";
$VERSION = "0.14_03";

my %mode = qw(w > r < a >>);

Expand Down Expand Up @@ -408,14 +408,20 @@ sub _write_dn {
sub write {
my $self = shift;

$self->{change} = 0;
$self->write_entry(@_);
$self->_write_entry(0, @_);
}

sub write_entry {
my $self = shift;

$self->_write_entry($self->{change}, @_);
}

# internal helper: write entry in different format depending on 1st arg
sub _write_entry {
my $self = shift;
my $change = shift;
my $entry;
my $change = $self->{change};
my $wrap = int($self->{'wrap'});
my $lower = $self->{'lowercase'};
my $sort = $self->{'sort'};
Expand Down Expand Up @@ -525,8 +531,7 @@ sub read_cmd {
sub write_cmd {
my $self = shift;

$self->{change} = 1;
$self->write_entry(@_);
$self->_write_entry(1, @_);
}

sub done {
Expand Down

0 comments on commit ba08c63

Please sign in to comment.