Fix another LCS edge case that rev #0cc20d93ff50 introduced.
authorMahlon E. Smith <mahlon@laika.com>
Fri, 26 Apr 2013 15:52:03 -0700
changeset 56 32e313d5d2d2
parent 55 d7392bebb86c
child 57 85cc85d0c1b1
Fix another LCS edge case that rev #0cc20d93ff50 introduced.
shelldap
--- a/shelldap	Thu Apr 18 12:07:56 2013 -0700
+++ b/shelldap	Fri Apr 26 15:52:03 2013 -0700
@@ -1,7 +1,7 @@
 #!/usr/bin/env perl
 # vim: set nosta noet ts=4 sw=4:
 #
-# Copyright (c) 2006-2012, Mahlon E. Smith <mahlon@martini.nu>
+# Copyright (c) 2006-2013, Mahlon E. Smith <mahlon@martini.nu>
 # All rights reserved.
 # Redistribution and use in source and binary forms, with or without
 # modification, are permitted provided that the following conditions are met:
@@ -1618,6 +1618,10 @@
 			#
 			foreach ( $diff->Items(1) ) {
 				my ( $attr, $val ) = $parse->( $_ ) or next;
+				my $cur_vals = $e->get_value( $attr, asref => 1 ) || [];
+				my $cur_valcount = scalar @$cur_vals;
+
+				next if $cur_valcount == 1;
 				next if $seen_attr{ $attr };
 				$self->debug("DELETE: $_");
 				$e->delete( $attr => [ $val ] );
@@ -2157,7 +2161,7 @@
 use warnings;
 
 $0 = 'shelldap';
-my $VERSION = '1.0.1';
+my $VERSION = '1.0.2';
 
 use Getopt::Long;
 use YAML::Syck;