From: Kartik S. <kar...@us...> - 2003-03-03 18:00:28
|
Update of /cvsroot/perl-ldap/ldap/lib/Net/LDAP In directory sc8-pr-cvs1:/tmp/cvs-serv26192 Modified Files: Entry.pm Log Message: Fixed clone(): update $clone->{changetype} and $clone->{changes}. (patch from David Faltermier) Index: Entry.pm =================================================================== RCS file: /cvsroot/perl-ldap/ldap/lib/Net/LDAP/Entry.pm,v retrieving revision 1.11 retrieving revision 1.12 diff -u -d -r1.11 -r1.12 --- Entry.pm 22 Feb 2003 18:26:39 -0000 1.11 +++ Entry.pm 3 Mar 2003 18:00:22 -0000 1.12 @@ -9,7 +9,7 @@ use Net::LDAP::Constant qw(LDAP_LOCAL_ERROR); use vars qw($VERSION); -$VERSION = "0.18"; +$VERSION = "0.19"; sub new { my $self = shift; @@ -27,6 +27,17 @@ $clone->dn($self->dn()); foreach ($self->attributes()) { $clone->add($_ => [$self->get_value($_)]); + } + + $clone->{changetype} = $self->{changetype}; + my @changes = @{$self->{changes}}; + while (my($action, $cmd) = splice(@changes,0,2)) { + my @new_cmd; + my @cmd = @$cmd; + while (my($type, $val) = splice(@cmd,0,2)) { + push @new_cmd, $type, [ @$val ]; + } + push @{$clone->{changes}}, $action, \@new_cmd; } $clone; |