diff options
author | Jay Sorg <jay.sorg@gmail.com> | 2014-04-20 00:42:19 -0700 |
---|---|---|
committer | Jay Sorg <jay.sorg@gmail.com> | 2014-04-20 00:42:19 -0700 |
commit | 1934c9ea00cb4cb35a2561273c8df8339c8023a1 (patch) | |
tree | 1e74bb18dae18c1bc0ade18c0562847d4ac467d1 /common | |
parent | 03a5914609298515ea2855f1cf45f3ba7d8cf170 (diff) | |
download | xrdp-proprietary-1934c9ea00cb4cb35a2561273c8df8339c8023a1.tar.gz xrdp-proprietary-1934c9ea00cb4cb35a2561273c8df8339c8023a1.zip |
sesman: more options for session lookup from Fredy Paquet
Diffstat (limited to 'common')
-rw-r--r-- | common/os_calls.c | 21 | ||||
-rw-r--r-- | common/os_calls.h | 1 |
2 files changed, 22 insertions, 0 deletions
diff --git a/common/os_calls.c b/common/os_calls.c index 16b89201..1d3a71b1 100644 --- a/common/os_calls.c +++ b/common/os_calls.c @@ -2266,6 +2266,27 @@ g_strncmp(const char *c1, const char *c2, int len) } /*****************************************************************************/ +/* compare up to delim */ +int APP_CC +g_strncmp_d(const char *s1, const char *s2, const char delim, int n) +{ + char c1; + char c2; + + while (n > 0) + { + c1 = *s1++; + c2 = *s2++; + if ((c1 == 0) || (c1 != c2) || (c1 == delim) || (c2 == delim)) + { + return c1 - c2; + } + n--; + } + return c1 - c2; +} + +/*****************************************************************************/ int APP_CC g_strcasecmp(const char *c1, const char *c2) { diff --git a/common/os_calls.h b/common/os_calls.h index 3afde05c..1805a6a1 100644 --- a/common/os_calls.h +++ b/common/os_calls.h @@ -115,6 +115,7 @@ char* APP_CC g_strdup(const char* in); char* APP_CC g_strndup(const char* in, const unsigned int maxlen); int APP_CC g_strcmp(const char* c1, const char* c2); int APP_CC g_strncmp(const char* c1, const char* c2, int len); +int APP_CC g_strncmp_d(const char* c1, const char* c2, const char delim, int len); int APP_CC g_strcasecmp(const char* c1, const char* c2); int APP_CC g_strncasecmp(const char* c1, const char* c2, int len); int APP_CC g_atoi(const char* str); |