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

* encoding.c (rb_enc_ascget): renamed from rb_enc_get_ascii.

* include/ruby/encoding.h: follow the renaming.

* re.c: ditto. 



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14195 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
akr 2007-12-11 07:39:16 +00:00
parent 7554dd1346
commit 646f27b822
4 changed files with 18 additions and 10 deletions

View file

@ -1,3 +1,11 @@
Tue Dec 11 16:37:47 2007 Tanaka Akira <akr@fsij.org>
* encoding.c (rb_enc_ascget): renamed from rb_enc_get_ascii.
* include/ruby/encoding.h: follow the renaming.
* re.c: ditto.
Tue Dec 11 16:19:26 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
* Makefile.in, */Makefile.sub (CP, MV): added.

View file

@ -505,7 +505,7 @@ rb_enc_precise_mbclen(const char *p, const char *e, rb_encoding *enc)
return n;
}
int rb_enc_get_ascii(const char *p, const char *e, int *len, rb_encoding *enc)
int rb_enc_ascget(const char *p, const char *e, int *len, rb_encoding *enc)
{
int c, l;
if (e <= p)

View file

@ -79,7 +79,7 @@ int rb_enc_precise_mbclen(const char *p, const char *e, rb_encoding *enc);
#define MBCLEN_NEEDMORE(ret) ONIGENC_MBCLEN_NEEDMORE(ret)
/* -> 0x00..0x7f, -1 */
int rb_enc_get_ascii(const char *p, const char *e, int *len, rb_encoding *enc);
int rb_enc_ascget(const char *p, const char *e, int *len, rb_encoding *enc);
/* code,encoding -> codelen */
int rb_enc_codelen(int, rb_encoding*);

16
re.c
View file

@ -222,7 +222,7 @@ rb_reg_expr_str(VALUE str, const char *s, long len)
p = s; pend = p + len;
while (p<pend) {
c = rb_enc_get_ascii(p, pend, &clen, enc);
c = rb_enc_ascget(p, pend, &clen, enc);
if (c == -1) {
p += mbclen(p, pend, enc);
}
@ -240,7 +240,7 @@ rb_reg_expr_str(VALUE str, const char *s, long len)
else {
p = s;
while (p<pend) {
c = rb_enc_get_ascii(p, pend, &clen, enc);
c = rb_enc_ascget(p, pend, &clen, enc);
if (c == '\\' && p+clen < pend) {
int n = clen + mbclen(p+clen, pend, enc);
rb_str_buf_cat(str, p, n);
@ -2387,7 +2387,7 @@ rb_reg_quote(VALUE str)
s = RSTRING_PTR(str);
send = s + RSTRING_LEN(str);
while (s < send) {
c = rb_enc_get_ascii(s, send, &clen, enc);
c = rb_enc_ascget(s, send, &clen, enc);
if (c == -1) {
s += mbclen(s, send, enc);
continue;
@ -2420,7 +2420,7 @@ rb_reg_quote(VALUE str)
t += s - RSTRING_PTR(str);
while (s < send) {
c = rb_enc_get_ascii(s, send, &clen, enc);
c = rb_enc_ascget(s, send, &clen, enc);
if (c == -1) {
int n = mbclen(s, send, enc);
@ -2694,7 +2694,7 @@ rb_reg_regsub(VALUE str, VALUE src, struct re_registers *regs, VALUE regexp)
e = s + RSTRING_LEN(str);
while (s < e) {
int c = rb_enc_get_ascii(s, e, &clen, enc);
int c = rb_enc_ascget(s, e, &clen, enc);
char *ss;
if (c == -1) {
@ -2711,7 +2711,7 @@ rb_reg_regsub(VALUE str, VALUE src, struct re_registers *regs, VALUE regexp)
}
rb_str_buf_cat(val, p, ss-p);
c = rb_enc_get_ascii(s, e, &clen, enc);
c = rb_enc_ascget(s, e, &clen, enc);
if (c == -1) {
s += mbclen(s, e, enc);
rb_str_buf_cat(val, ss, s-ss);
@ -2732,12 +2732,12 @@ rb_reg_regsub(VALUE str, VALUE src, struct re_registers *regs, VALUE regexp)
break;
case 'k':
if (s < e && rb_enc_get_ascii(s, e, &clen, enc) == '<') {
if (s < e && rb_enc_ascget(s, e, &clen, enc) == '<') {
char *name, *name_end;
name_end = name = s + clen;
while (name_end < e) {
c = rb_enc_get_ascii(name_end, e, &clen, enc);
c = rb_enc_ascget(name_end, e, &clen, enc);
if (c == '>') break;
name_end += c == -1 ? mbclen(name_end, e, enc) : clen;
}