[gmime] Fixed GMimeStreamCat::substream to properly handle start == end



commit 05cab94dfb6a57ec46cd1527ba6115feecd97fae
Author: Jeffrey Stedfast <fejj gnome org>
Date:   Tue Jul 2 09:53:14 2013 -0400

    Fixed GMimeStreamCat::substream to properly handle start == end
    
    2013-07-02  Jeffrey Stedfast  <fejj gnome org>
    
        * gmime/gmime-stream-cat.c (stream_substream): Fixed to properly
        handle a 0-byte substream at the end of the very last source
        stream. Fixes bug #701572.

 ChangeLog                |    6 ++++++
 gmime/gmime-stream-cat.c |    3 +++
 2 files changed, 9 insertions(+), 0 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 68b18bc..ef9a13a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2013-07-02  Jeffrey Stedfast  <fejj gnome org>
+
+       * gmime/gmime-stream-cat.c (stream_substream): Fixed to properly
+       handle a 0-byte substream at the end of the very last source
+       stream. Fixes bug #701572.
+
 2013-06-30  Jeffrey Stedfast  <fejj gnome org>
 
        * README: Bumped version
diff --git a/gmime/gmime-stream-cat.c b/gmime/gmime-stream-cat.c
index b543f96..bf0469d 100644
--- a/gmime/gmime-stream-cat.c
+++ b/gmime/gmime-stream-cat.c
@@ -580,6 +580,9 @@ stream_substream (GMimeStream *stream, gint64 start, gint64 end)
                if ((offset + len) > start)
                        break;
                
+               if (end != -1 && (offset + len) >= end)
+                       break;
+               
                offset += len;
                
                n = n->next;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]