Terminal (macOS): fix compatibility with Fig

This commit is contained in:
李通洲
2023-07-16 20:39:28 +08:00
parent c1d5a3eb1c
commit eea70020c3
2 changed files with 15 additions and 0 deletions
+9
View File
@@ -25,6 +25,15 @@ static inline bool ffStrStartsWith(const char* str, const char* compareTo)
return strncmp(str, compareTo, strlen(compareTo)) == 0;
}
static inline bool ffStrEndsWith(const char* str, const char* compareTo)
{
size_t strLength = strlen(str);
size_t compareToLength = strlen(compareTo);
if (strLength < compareToLength)
return false;
return memcmp(str + strLength - compareToLength, compareTo, compareToLength) == 0;
}
static inline bool ffStrEquals(const char* str, const char* compareTo)
{
return strcmp(str, compareTo) == 0;