diff options
Diffstat (limited to 'common/sys')
-rw-r--r-- | common/sys/string.c | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/common/sys/string.c b/common/sys/string.c index 8754e00c..02c5eb98 100644 --- a/common/sys/string.c +++ b/common/sys/string.c @@ -258,7 +258,8 @@ strip_nonebig5(unsigned char *str, int maxlen) } /** - * DBCS_RemoveIntrEscape(buf, len): �h�� buf �����@�r����C + * DBCS_RemoveIntrEscape(buf, len): �h�� DBCS �@�r����r�C + * (deprecated) */ int DBCS_RemoveIntrEscape(unsigned char *buf, int *len) { @@ -322,7 +323,7 @@ int DBCS_RemoveIntrEscape(unsigned char *buf, int *len) } /** - * DBCS_Status(dbcstr, pos): �Ǧ^ dbcstr �� pos ��m�r�������A�C + * DBCS_Status(dbcstr, pos): ���o�r�ꤤ���w��m�� DBCS ���A�C */ int DBCS_Status(const char *dbcstr, int pos) { @@ -344,8 +345,10 @@ int DBCS_Status(const char *dbcstr, int pos) return sts; } -// return: 1 - found, 0 - fail. -int +/** + * DBCS_strcasestr(pool, ptr): �b�r�� pool ���M�� ptr (�u�����^��j�p�g) + */ +const char * DBCS_strcasestr(const char* pool, const char *ptr) { int i = 0, i2 = 0, found = 0, @@ -382,13 +385,14 @@ DBCS_strcasestr(const char* pool, const char *ptr) } } - if (found) break; + if (found) + return pool+i; // next iteration: if target is DBCS, skip one more byte. if (pool[i] < 0) i++; } - return found; + return NULL; } /* ----------------------------------------------------- */ |