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
749eff46
...
749eff466fc8e040e20b1073ca4acc2b1c7ae240
authored
2004-02-03 13:12:29 +0000
by
Sergey Poznyakoff
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
(maildir_message_cmp): Compare the
rest of filenames if the timestamps are equal
1 parent
8e0d7f56
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
31 additions
and
3 deletions
mailbox/maildir/mbox.c
mailbox/maildir/mbox.c
View file @
749eff4
...
...
@@ -134,15 +134,43 @@ info_to_flags (char *buf)
static
int
maildir_message_cmp
(
struct
_amd_message
*
a
,
struct
_amd_message
*
b
)
{
char
*
name_a
,
*
name_b
;
unsigned
long
na
=
strtoul
(((
struct
_maildir_message
*
)
a
)
->
file_name
,
NULL
,
10
);
&
name_a
,
10
);
unsigned
long
nb
=
strtoul
(((
struct
_maildir_message
*
)
b
)
->
file_name
,
NULL
,
10
);
&
name_b
,
10
);
int
rc
;
if
(
na
>
nb
)
return
1
;
if
(
na
<
nb
)
return
-
1
;
return
0
;
/* If timestamps are equal, compare rests of the filenames up to the
info marker */
if
(
name_a
&&
!
name_b
)
return
1
;
else
if
(
!
name_a
)
{
if
(
name_b
)
return
-
1
;
else
return
0
;
}
for
(;
*
name_a
&&
*
name_a
!=
':'
&&
*
name_b
&&
*
name_b
!=
':'
;
name_a
++
,
name_b
++
)
if
((
rc
=
(
*
name_a
-
*
name_b
)))
return
rc
;
if
(
*
name_a
==
':'
&&
*
name_b
==
':'
)
{
name_a
++
;
name_b
++
;
}
return
*
name_a
-
*
name_b
;
}
void
...
...
Please
register
or
sign in
to post a comment