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
3a5017a5
...
3a5017a550a95d903e6bdbad5099860b76e53df9
authored
2005-08-31 09:27:25 +0000
by
Sergey Poznyakoff
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
(guess_level,list_copy): Fixed
(imap_parse): Handle NO case explicitely.
1 parent
f9386077
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
7 deletions
mailbox/imap/folder.c
mailbox/imap/folder.c
View file @
3a5017a
...
...
@@ -797,12 +797,17 @@ folder_imap_delete (mu_folder_t folder, const char *name)
void
guess_level
(
struct
mu_list_response
*
resp
,
size_t
prefix_len
)
{
char
*
p
;
size_t
lev
=
0
;
for
(
p
=
strchr
(
resp
->
name
+
prefix_len
,
resp
->
separator
);
p
;
p
=
strchr
(
p
+
1
,
resp
->
separator
))
if
(
!
resp
->
separator
)
lev
=
0
;
else
{
char
*
p
=
resp
->
name
+
prefix_len
;
if
(
p
[
0
]
==
resp
->
separator
)
for
(
;
p
;
p
=
strchr
(
p
+
1
,
resp
->
separator
))
lev
++
;
}
resp
->
level
=
lev
;
}
...
...
@@ -828,11 +833,15 @@ list_copy (mu_list_t dst, mu_list_t src,
for
(
mu_iterator_first
(
itr
);
!
mu_iterator_is_done
(
itr
);
mu_iterator_next
(
itr
))
{
char
*
name
;
struct
mu_list_response
*
p
;
mu_iterator_current
(
itr
,
(
void
**
)
&
p
);
guess_level
(
p
,
prefix_len
);
if
((
max_level
==
0
||
p
->
level
<
max_level
)
&&
(
!
namecmp
||
namecmp
(
pattern
,
p
->
name
)
==
0
))
name
=
p
->
name
+
prefix_len
;
if
(
name
[
0
]
==
p
->
separator
&&
pattern
[
0
]
!=
p
->
separator
)
name
++
;
if
((
max_level
==
0
||
p
->
level
<=
max_level
)
&&
(
!
namecmp
||
namecmp
(
pattern
,
name
)
==
0
))
mu_list_append
(
dst
,
p
);
else
free
(
p
);
...
...
@@ -2437,7 +2446,7 @@ imap_parse (f_imap_t f_imap)
{
/* Cool we are doing ok. */
}
else
/* NO and BAD */
else
if
(
strcasecmp
(
response
,
"NO"
)
==
0
)
{
if
(
strncasecmp
(
remainder
,
"LOGIN"
,
5
)
==
0
)
{
...
...
@@ -2446,13 +2455,17 @@ imap_parse (f_imap_t f_imap)
mu_observable_notify
(
observable
,
MU_EVT_AUTHORITY_FAILED
);
status
=
MU_ERR_AUTH_FAILURE
;
}
else
if
(
strncasecmp
(
remainder
,
"LIST"
,
4
)
==
0
)
status
=
MU_ERR_NOENT
;
else
status
=
MU_ERR_FAILURE
;
}
else
/* NO and BAD */
{
status
=
EINVAL
;
mu_error
(
"NO/Bad Tagged: %s %s
\n
"
,
response
,
remainder
);
}
}
}
f_imap
->
ptr
=
f_imap
->
buffer
;
}
...
...
Please
register
or
sign in
to post a comment