aboutsummaryrefslogtreecommitdiff
path: root/libssh/misc.c
diff options
context:
space:
mode:
Diffstat (limited to 'libssh/misc.c')
-rw-r--r--libssh/misc.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/libssh/misc.c b/libssh/misc.c
index 8ca37646..4489eb69 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;