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
c74ba0ec
...
c74ba0ecdda6dc824b9c2918b5dd9f962974c1e3
authored
2001-08-31 07:09:54 +0000
by
Sergey Poznyakoff
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
Use linear hash ordering.
1 parent
e56a76a9
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
10 deletions
mail/alias.c
mail/alias.c
View file @
c74ba0e
...
...
@@ -135,14 +135,9 @@ alias_lookup_or_install(char *name, int install)
pos
=
hash
(
name
);
for
(
i
=
pos
;;)
for
(
i
=
pos
;
aliases
[
i
].
name
;)
{
if
(
aliases
[
i
].
name
==
NULL
)
{
if
(
!
slot
&&
install
)
slot
=
&
aliases
[
i
];
}
else
if
(
strcmp
(
aliases
[
i
].
name
,
name
)
==
0
)
if
(
strcmp
(
aliases
[
i
].
name
,
name
)
==
0
)
return
&
aliases
[
i
];
if
(
++
i
>=
hash_size
[
hash_num
])
i
=
0
;
...
...
@@ -153,8 +148,8 @@ alias_lookup_or_install(char *name, int install)
if
(
!
install
)
return
NULL
;
if
(
slot
)
return
slot
;
if
(
aliases
[
i
].
name
==
NULL
)
return
&
aliases
[
i
]
;
if
(
alias_rehash
())
return
NULL
;
...
...
@@ -236,12 +231,29 @@ alias_print_group(char *name, list_t list)
void
alias_destroy
(
char
*
name
)
{
int
i
,
j
,
r
;
alias_t
*
alias
=
alias_lookup_or_install
(
name
,
0
);
if
(
!
alias
)
return
;
free
(
alias
->
name
);
alias
->
name
=
NULL
;
util_slist_destroy
(
&
alias
->
list
);
for
(
i
=
alias
-
aliases
;;)
{
aliases
[
i
].
name
=
NULL
;
j
=
i
;
do
{
if
(
++
i
>=
hash_size
[
hash_num
])
i
=
0
;
if
(
!
aliases
[
i
].
name
)
return
;
r
=
hash
(
aliases
[
i
].
name
);
}
while
((
j
<
r
&&
r
<=
i
)
||
(
i
<
j
&&
j
<
r
)
||
(
r
<=
i
&&
i
<
j
));
aliases
[
j
]
=
aliases
[
i
];
}
}
char
*
...
...
Please
register
or
sign in
to post a comment