1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39
|
#! /bin/sh /usr/share/dpatch/dpatch-run
## 40namespace.dpatch by Niko Tyni <ntyni@iki.fi>
##
## All lines beginning with `## DP:' are a description of the patch.
## DP: Fix an issue with the namespace function returning NIL. (#256837)
## DP: Originally by Jaldhar H. Vyas
@DPATCH@
diff -urNad trunk~/Net/IMAP.pm trunk/Net/IMAP.pm
--- trunk~/Net/IMAP.pm 2006-05-13 20:42:29.000000000 +0300
+++ trunk/Net/IMAP.pm 2006-05-13 20:42:47.601777427 +0300
@@ -2394,14 +2394,21 @@
$self->{Parent} = $parent;
my $fields = Net::xAP->parse_fields($str);
- for my $n (0 .. 2) {
- my $field = $fields->[$n];
- for my $item (@{$field}) {
- $item->[1] = '' if (lc($item->[1]) eq 'nil');
- $self->{Namespaces}{$namespace_types[$n]}{$item->[0]} = $item->[1];
+ if (lc($fields->[1]) eq 'nil')
+ {
+ for my $n (0 .. 2) {
+ $self->{Namespaces}{$namespace_types[$n]}{$fields->[0]} = '';
+ }
+ }
+ else
+ {
+ for my $n (0 .. 2) {
+ my $field = $fields->[$n];
+ for my $item (@{$field}) {
+ $self->{Namespaces}{$namespace_types[$n]}{$item->[0]} = $item->[1];
+ }
}
}
-
return $self;
}
|