mirror of
https://git.libssh.org/projects/libssh.git
synced 2026-02-06 10:27:22 +09:00
Move ssh_match_group() from misc.c to match.c
ssh_match_group() has been moved from misc.c to match.c, because it fits better with other match_*() functions in match.c The name of the function has also been changed from "ssh_match_group" to "match_group" to be consistent with the naming of the other match.c functions. Signed-off-by: Eshan Kelkar <eshankelkar@galorithm.com> Reviewed-by: Jakub Jelen <jjelen@redhat.com> Reviewed-by: Sahana Prasad <sahana@redhat.com>
This commit is contained in:
committed by
Sahana Prasad
parent
21627509f5
commit
d41a0aaa13
26
src/misc.c
26
src/misc.c
@@ -1571,32 +1571,6 @@ int ssh_timeout_update(struct ssh_timestamp *ts, int timeout)
|
||||
return ret >= 0 ? ret: 0;
|
||||
}
|
||||
|
||||
|
||||
int ssh_match_group(const char *group, const char *object)
|
||||
{
|
||||
const char *a;
|
||||
const char *z;
|
||||
|
||||
z = group;
|
||||
do {
|
||||
a = strchr(z, ',');
|
||||
if (a == NULL) {
|
||||
if (strcmp(z, object) == 0) {
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
} else {
|
||||
if (strncmp(z, object, a - z) == 0) {
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
z = a + 1;
|
||||
} while(1);
|
||||
|
||||
/* not reached */
|
||||
return 0;
|
||||
}
|
||||
|
||||
#if !defined(HAVE_EXPLICIT_BZERO)
|
||||
void explicit_bzero(void *s, size_t n)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user