Common header file change; not applicable to open-vm-tools.
/*********************************************************
- * Copyright (C) 1998-2016 VMware, Inc. All rights reserved.
+ * Copyright (C) 1998-2017 VMware, Inc. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as published
Bool StrUtil_StartsWith(const char *s, const char *prefix);
Bool StrUtil_CaselessStartsWith(const char *s, const char *prefix);
Bool StrUtil_EndsWith(const char *s, const char *suffix);
+Bool StrUtil_CaselessEndsWith(const char *s, const char *suffix);
Bool StrUtil_IsASCII(const char *s);
Bool StrUtil_VDynBufPrintf(struct DynBuf *b, const char *fmt, va_list args);
#define FLEX_CLIENT_VERSION_NUMBER "8.0.0"
#define FLEX_CLIENT_VERSION "e.x.p"
-#define GANTRY_VERSION "e.x.p"
+#define GANTRY_VERSION "1.0.0"
/*
* In the *-main branches, FUSION_VERSION should always be set to "e.x.p".
size_t slen;
size_t suffixlen;
- ASSERT(s);
- ASSERT(suffix);
+ ASSERT(s != NULL);
+ ASSERT(suffix != NULL);
slen = strlen(s);
suffixlen = strlen(suffix);
}
+/*
+ *-----------------------------------------------------------------------------
+ *
+ * StrUtil_CaselessEndsWith --
+ *
+ * A case-insensitive version of StrUtil_EndsWith.
+ *
+ * Results:
+ * TRUE if string 'suffix' is found at the end of string 's'
+ * FALSE otherwise.
+ *
+ * Side effects:
+ * None.
+ *
+ *-----------------------------------------------------------------------------
+ */
+
+Bool
+StrUtil_CaselessEndsWith(const char *s, // IN
+ const char *suffix) // IN
+{
+ size_t slen;
+ size_t suffixlen;
+
+ ASSERT(s != NULL);
+ ASSERT(suffix != NULL);
+ ASSERT(StrUtil_IsASCII(suffix));
+
+ slen = strlen(s);
+ suffixlen = strlen(suffix);
+
+ if (suffixlen > slen) {
+ return FALSE;
+ }
+
+ return Str_Strcasecmp(s + (slen - suffixlen), suffix) == 0;
+}
+
+
/*
*-----------------------------------------------------------------------------
*