[2779] in BarnOwl Developers

home help back first fref pref prev next nref lref last post

[PATCH 3/3] Merged the last change from upstream (XML::Stream version 1.23).

daemon@ATHENA.MIT.EDU (Jason Gross)
Sun Nov 14 10:20:43 2010

From: Jason Gross <jgross@MIT.EDU>
To: barnowl-dev@mit.edu
Date: Sun, 14 Nov 2010 10:20:38 -0500
In-Reply-To: <1289748038-5882-1-git-send-email-jgross@mit.edu>

See ticket #152.  (https://barnowl.mit.edu:444/ticket/152)  This merges
the last, major, change from XML::Stream version 1.23.  This code may do
the same thing as our original code, but it might not.  Someone with
good knowledge of the relevant code (perhaps asedeno, who made the
relevant commits -
https://github.com/barnowl/barnowl/blame/master/perl/modules/Jabber/lib/XML/Stream/Parser.pm
and
https://github.com/barnowl/barnowl/commit/ea215acf582ad1dae07bc35879171b3a3f2dad81)
should look at this and determine if the new code DTRT.  If not, we
should submit a bug report upstream, and this patch should be discarded.
If so, this commit message should be made useful (alternatively, if all
three patches work fine, we can just replace our XML::Stream with the
1.23 version, and commit that change).
---
 perl/modules/Jabber/lib/XML/Stream/Parser.pm |   13 ++++++-------
 1 files changed, 6 insertions(+), 7 deletions(-)

diff --git a/perl/modules/Jabber/lib/XML/Stream/Parser.pm b/perl/modules/Jabber/lib/XML/Stream/Parser.pm
index f1f95f8..a84484b 100644
--- a/perl/modules/Jabber/lib/XML/Stream/Parser.pm
+++ b/perl/modules/Jabber/lib/XML/Stream/Parser.pm
@@ -383,18 +383,17 @@ sub attribution
         my $id;
         my $id1 = index($str,"\'");
         my $id2 = index($str,"\"");
-
-	return %attribs if ($id1 == -1 && $id2 == -1);
-
         if((($id1 < $id2) && ($id1 != -1)) || ($id2 == -1))
         {
             $ids = $id1;
             $id = "\'";
         }
-        if((($id2 < $id1) && ($id2 != -1)) || ($id1 == -1))
-        {
-            $ids = $id2;
-            $id = "\"";
+        else {
+            if((($id2 < $id1) && ($id1 == -1)) || ($id2 != -1))
+            {
+                $ids = $id2;
+                $id = "\"";
+            }
         }
 
         my $nextid = index($str,$id,$ids+1);
-- 
1.7.1


home help back first fref pref prev next nref lref last post