зеркало из https://github.com/github/ruby.git
* defines.h: define RUBY_MBCHAR_MAX instead of MB_CUR_MAX.
* dir.c (Next, emx_mblen): use RUBY_MBCHAR_MAX for mblen(). * file.c (CharNext): ditto. * ruby.c (translate_char): ditto. * util.c (__crt0_glob_function): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@5530 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
Родитель
cb3cf6cfea
Коммит
fc69b2a7f6
|
@ -1,3 +1,11 @@
|
|||
Thu Jan 22 00:12:51 2004 Siena. <siena@faculty.chiba-u.jp>
|
||||
|
||||
* defines.h: define RUBY_MBCHAR_MAX instead of MB_CUR_MAX.
|
||||
* dir.c (Next, emx_mblen): use RUBY_MBCHAR_MAX for mblen().
|
||||
* file.c (CharNext): ditto.
|
||||
* ruby.c (translate_char): ditto.
|
||||
* util.c (__crt0_glob_function): ditto.
|
||||
|
||||
Thu Jan 22 00:10:01 2004 Dave Thomas <dave@pragprog.com>
|
||||
|
||||
* lib/base64.rb: :nodoc: the Deprecated module
|
||||
|
|
|
@ -203,6 +203,11 @@ typedef int pid_t;
|
|||
#define EXTERN RUBY_EXTERN /* deprecated */
|
||||
#endif
|
||||
|
||||
#ifndef RUBY_MBCHAR_MAXSIZE
|
||||
#define RUBY_MBCHAR_MAXSIZE INT_MAX
|
||||
/* MB_CUR_MAX will not work well in C locale */
|
||||
#endif
|
||||
|
||||
#if defined(sparc) || defined(__sparc__)
|
||||
static inline void
|
||||
flush_register_windows(void)
|
||||
|
|
4
dir.c
4
dir.c
|
@ -85,14 +85,14 @@ char *strchr _((char*,char));
|
|||
#if defined(CharNext)
|
||||
# define Next(p) CharNext(p)
|
||||
#elif defined(DJGPP)
|
||||
# define Next(p) ((p) + mblen(p, MB_CUR_MAX))
|
||||
# define Next(p) ((p) + mblen(p, RUBY_MBCHAR_MAXSIZE))
|
||||
#elif defined(__EMX__)
|
||||
# define Next(p) ((p) + emx_mblen(p))
|
||||
static inline int
|
||||
emx_mblen(p)
|
||||
const char *p;
|
||||
{
|
||||
int n = mblen(p, INT_MAX);
|
||||
int n = mblen(p, RUBY_MBCHAR_MAXSIZE);
|
||||
return (n < 0) ? 1 : n;
|
||||
}
|
||||
#endif
|
||||
|
|
2
file.c
2
file.c
|
@ -2120,7 +2120,7 @@ rb_file_s_umask(argc, argv)
|
|||
#endif
|
||||
#ifndef CharNext /* defined as CharNext[AW] on Windows. */
|
||||
# if defined(DJGPP)
|
||||
# define CharNext(p) ((p) + mblen(p, MB_CUR_MAX))
|
||||
# define CharNext(p) ((p) + mblen(p, RUBY_MBCHAR_MAXSIZE))
|
||||
# else
|
||||
# define CharNext(p) ((p) + 1)
|
||||
# endif
|
||||
|
|
2
ruby.c
2
ruby.c
|
@ -226,7 +226,7 @@ translate_char(p, from, to)
|
|||
#ifdef CharNext /* defined as CharNext[AW] on Windows. */
|
||||
p = CharNext(p);
|
||||
#else
|
||||
p += mblen(p, MB_CUR_MAX);
|
||||
p += mblen(p, RUBY_MBCHAR_MAXSIZE);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
|
2
util.c
2
util.c
|
@ -347,7 +347,7 @@ __crt0_glob_function(char *path)
|
|||
strncpy(buf, path, len);
|
||||
buf[len] = '\0';
|
||||
|
||||
for (p = buf; *p; p += mblen(p, MB_CUR_MAX))
|
||||
for (p = buf; *p; p += mblen(p, RUBY_MBCHAR_MAXSIZE))
|
||||
if (*p == '\\')
|
||||
*p = '/';
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче