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
88b95232
...
88b95232237d4cc43cc49a4371931ea1b7a8a2b7
authored
2008-02-08 14:18:25 +0000
by
Sergey Poznyakoff
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
(act_getline): Bugfix. Do not return eof on an empty line. Reported by Damon Harper.
1 parent
689db961
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
3 deletions
comsat/action.c
comsat/action.c
View file @
88b9523
...
...
@@ -48,17 +48,20 @@ act_getline (FILE *fp, char **sptr, size_t *size)
size_t
used
=
0
;
unsigned
lines
=
0
;
if
(
feof
(
fp
))
return
0
;
while
(
cont
&&
fgets
(
buf
,
sizeof
buf
,
fp
))
{
int
len
=
strlen
(
buf
);
if
(
buf
[
len
-
1
]
==
'\n'
)
{
lines
++
;
buf
[
--
len
]
=
0
;
if
(
buf
[
len
-
1
]
==
'\\'
)
{
buf
[
--
len
]
=
0
;
cont
=
1
;
lines
++
;
}
else
cont
=
0
;
...
...
@@ -80,8 +83,6 @@ act_getline (FILE *fp, char **sptr, size_t *size)
if
(
*
sptr
)
(
*
sptr
)[
used
]
=
0
;
if
(
used
&&
!
feof
(
fp
))
lines
++
;
return
lines
;
}
...
...
Please
register
or
sign in
to post a comment