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
bcf509b0
...
bcf509b08c28b5ec3d915d4c5e5f2fff0ecbbb2c
authored
2007-06-26 20:16:17 +0000
by
Sergey Poznyakoff
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
(mu_hdrent_find): Allow negative instance indices, meaning scanning from the bottom up.
1 parent
ab8cfdaf
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
3 deletions
mailbox/header.c
mailbox/header.c
View file @
bcf509b
...
...
@@ -75,9 +75,21 @@ static struct mu_hdrent *
mu_hdrent_find
(
struct
_mu_header
*
hdr
,
const
char
*
name
,
int
pos
)
{
struct
mu_hdrent
*
p
;
for
(
p
=
hdr
->
head
;
p
;
p
=
p
->
next
)
if
(
strcasecmp
(
MU_HDRENT_NAME
(
hdr
,
p
),
name
)
==
0
&&
pos
--
==
1
)
break
;
if
(
pos
>
0
)
{
for
(
p
=
hdr
->
head
;
p
;
p
=
p
->
next
)
if
(
strcasecmp
(
MU_HDRENT_NAME
(
hdr
,
p
),
name
)
==
0
&&
pos
--
==
1
)
break
;
}
else
if
(
pos
<
0
)
{
for
(
p
=
hdr
->
tail
;
p
;
p
=
p
->
prev
)
if
(
strcasecmp
(
MU_HDRENT_NAME
(
hdr
,
p
),
name
)
==
0
&&
++
pos
==
0
)
break
;
}
else
p
=
NULL
;
return
p
;
}
...
...
Please
register
or
sign in
to post a comment