From 14eb593af3c41ea439f01d34aaae497d8420f316 Mon Sep 17 00:00:00 2001 From: Ruben Garcia Azuara Date: Tue, 6 Apr 2010 19:39:41 +0200 Subject: Fixed solaris compilation warning and ignore case at host parameter. - Suppress compilation warning in solaris caused by a comma at the end of the last value. - Ignore case at host parameter in config file Signed-off-by: Ruben Garcia Azuara Signed-off-by: Andreas Schneider --- libssh/misc.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'libssh/misc.c') diff --git a/libssh/misc.c b/libssh/misc.c index 8ca3764..4489eb6 100644 --- a/libssh/misc.c +++ b/libssh/misc.c @@ -121,6 +121,25 @@ int gettimeofday(struct timeval *__p, void *__t) { #define NSS_BUFLEN_PASSWD 4096 #endif +char *ssh_lowercase(const char* str) { + char *new, *p; + + if (str == NULL) { + return NULL; + } + + new = strdup(str); + if (new == NULL) { + return NULL; + } + + for (p = new; *p; p++) { + *p = tolower(*p); + } + + return new; +} + char *ssh_get_user_home_dir(void) { char *szPath = NULL; struct passwd pwd; -- cgit