1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* wince/stdlib.c: add mblen().

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3911 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
uema2 2003-06-05 12:33:19 +00:00
parent b1937a53e6
commit b5d717afda
2 changed files with 21 additions and 0 deletions

View file

@ -1,3 +1,7 @@
Thu Jun 5 21:31:55 2003 Takaaki Uematsu <uema2x@jcom.home.ne.jp>
* wince/stdlib.c: add mblen().
Thu Jun 5 18:33:46 2003 WATANABE Hirofumi <eban@ruby-lang.org>
* ext/curses/curses.c (window_s_allocate,curses_finalize):

View file

@ -20,3 +20,20 @@ char *_fullpath(char *absPath, const char *relPath,
return absPath;
}
int mblen(const char *mbstr, size_t count)
{
const char *p = mbstr;
size_t i;
int n=0;
for( i=0; i<count; i++ )
{
if( *p=='\0' ) break;
if( IsDBCSLeadByteEx( CP_ACP, *p ) )
n+=2;
else
n+=1;
}
return n;
}