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
ff7f3adc
...
ff7f3adc01f6c753c078e7a4012d1040f343c124
authored
2006-01-24 14:32:10 +0000
by
Sergey Poznyakoff
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
(mh_is_my_name): Bugfix: do not use strtok_r, which modifies its argument.
1 parent
975185d5
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
29 additions
and
5 deletions
mh/mh_init.c
mh/mh_init.c
View file @
ff7f3ad
...
...
@@ -169,12 +169,36 @@ mh_is_my_name (char *name)
char
*
nlist
=
mh_global_profile_get
(
"Alternate-Mailboxes"
,
NULL
);
if
(
nlist
)
{
char
*
p
,
*
sp
;
char
*
end
,
*
p
,
*
pat
;
int
len
;
p
=
strtok_r
(
nlist
,
","
,
&
sp
);
do
rc
=
emailcmp
(
p
,
pname
)
==
0
;
while
(
rc
==
0
&&
(
p
=
strtok_r
(
NULL
,
","
,
&
sp
)));
for
(
p
=
nlist
;
rc
==
0
&&
*
p
;
p
=
end
)
{
while
(
*
p
&&
isspace
(
*
p
))
p
++
;
end
=
strchr
(
p
,
','
);
if
(
end
)
{
len
=
end
-
p
;
end
++
;
}
else
{
len
=
strlen
(
p
);
end
=
p
+
len
;
}
while
(
len
>
0
&&
isspace
(
p
[
len
-
1
]))
len
--
;
pat
=
xmalloc
(
len
+
1
);
memcpy
(
pat
,
p
,
len
);
pat
[
len
]
=
0
;
rc
=
emailcmp
(
pat
,
pname
)
==
0
;
free
(
pat
);
}
}
}
free
(
pname
);
...
...
Please
register
or
sign in
to post a comment