Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
John McEleney
/
mailutils
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
Commit
37fcd5c1
...
37fcd5c14e6e258cda738c99bdf4cad51bc63643
authored
2009-03-22 19:17:42 +0200
by
Sergey Poznyakoff
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
Bugfix.
* mailbox/stream.c (mu_stream_readline): Fix byte counting.
1 parent
c37b2f1f
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
8 deletions
mailbox/stream.c
mailbox/stream.c
View file @
37fcd5c
/* 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. */
{
...
...
Please
register
or
sign in
to post a comment