commit-mailutils
[Top][All Lists]
Advanced

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

[SCM] GNU Mailutils branch, master, updated. mu-1-2-90-separate-argp-cfg


From: Sergey Poznyakoff
Subject: [SCM] GNU Mailutils branch, master, updated. mu-1-2-90-separate-argp-cfg-244-g37fcd5c
Date: Sun, 22 Mar 2009 17:21:19 +0000

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU Mailutils".

http://git.savannah.gnu.org/cgit/mailutils.git/commit/?id=37fcd5c14e6e258cda738c99bdf4cad51bc63643

The branch, master has been updated
       via  37fcd5c14e6e258cda738c99bdf4cad51bc63643 (commit)
      from  c37b2f1f3e51dc5489b349cba20771cd762db148 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 37fcd5c14e6e258cda738c99bdf4cad51bc63643
Author: Sergey Poznyakoff <address@hidden>
Date:   Sun Mar 22 19:17:42 2009 +0200

    Bugfix.
    
    * mailbox/stream.c (mu_stream_readline): Fix byte counting.

-----------------------------------------------------------------------

Summary of changes:
 mailbox/stream.c |   13 +++++--------
 1 files changed, 5 insertions(+), 8 deletions(-)

diff --git a/mailbox/stream.c b/mailbox/stream.c
index edd4076..208ca0b 100644
--- a/mailbox/stream.c
+++ b/mailbox/stream.c
@@ -1,6 +1,6 @@
 /* GNU Mailutils -- a suite of utilities for electronic mail
    Copyright (C) 1999, 2000, 2001, 2004, 2005,
-   2006, 2007 Free Software Foundation, Inc.
+   2006, 2007, 2009 Free Software Foundation, Inc.
 
    This library is free software; you can redistribute it and/or
    modify it under the terms of the GNU Lesser General Public
@@ -298,7 +298,7 @@ mu_stream_readline (mu_stream_t is, char *buf, size_t count,
       size_t n, nr = 0;
       char c;
       /* Grossly inefficient hopefully they override this */
-      for (n = 1; n < count; n++)
+      for (n = 0; n < count; )
        {
          status = is->_read (is, &c, 1, offset, &nr);
          if (status != 0) /* Error.  */
@@ -307,19 +307,16 @@ mu_stream_readline (mu_stream_t is, char *buf, size_t 
count,
            {
              *buf++ = c;
              offset++;
+             n++;
              if (c == '\n') /* Newline is stored like fgets().  */
                break;
            }
          else if (nr == 0)
-           {
-             if (n == 1) /* EOF, no data read.  */
-               n = 0;
-             break; /* EOF, some data was read.  */
-           }
+           break; /* EOF */
        }
       *buf = '\0';
       if (pnread)
-       *pnread = (n == count) ? n - 1: n;
+       *pnread = n;
     }
   else /* Buffered.  */
     {


hooks/post-receive
--
GNU Mailutils




reply via email to

[Prev in Thread] Current Thread [Next in Thread]