mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
checkin leftovers
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_6@1365 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
4b4a670958
commit
bfc20f8ca3
3 changed files with 22 additions and 9 deletions
4
eval.c
4
eval.c
|
@ -1844,14 +1844,14 @@ is_defined(self, node, buf)
|
|||
break;
|
||||
|
||||
case NODE_NTH_REF:
|
||||
if (rb_reg_nth_defined(node->nd_nth, MATCH_DATA)) {
|
||||
if (RTEST(rb_reg_nth_defined(node->nd_nth, MATCH_DATA))) {
|
||||
sprintf(buf, "$%d", node->nd_nth);
|
||||
return buf;
|
||||
}
|
||||
break;
|
||||
|
||||
case NODE_BACK_REF:
|
||||
if (rb_reg_nth_defined(0, MATCH_DATA)) {
|
||||
if (RTEST(rb_reg_nth_defined(0, MATCH_DATA))) {
|
||||
sprintf(buf, "$%c", node->nd_nth);
|
||||
return buf;
|
||||
}
|
||||
|
|
|
@ -185,6 +185,18 @@ rb_gdbm_fetch2(dbm, keystr)
|
|||
return rb_gdbm_fetch(dbm, key);
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rb_gdbm_fetch3(obj, keystr)
|
||||
VALUE obj, keystr;
|
||||
{
|
||||
struct dbmdata *dbmp;
|
||||
GDBM_FILE dbm;
|
||||
|
||||
GetDBM(obj, dbmp);
|
||||
dbm = dbmp->di_dbm;
|
||||
return rb_gdbm_fetch2(dbm, keystr);
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rb_gdbm_firstkey(dbm)
|
||||
GDBM_FILE dbm;
|
||||
|
@ -260,7 +272,7 @@ static VALUE
|
|||
fgdbm_aref(obj, keystr)
|
||||
VALUE obj, keystr;
|
||||
{
|
||||
return fgdbm_fetch(obj, keystr, Qnil);
|
||||
return rb_gdbm_fetch3(obj, keystr);
|
||||
}
|
||||
|
||||
static VALUE
|
||||
|
@ -315,7 +327,7 @@ fgdbm_indexes(argc, argv, obj)
|
|||
|
||||
new = rb_ary_new2(argc);
|
||||
for (i=0; i<argc; i++) {
|
||||
rb_ary_push(new, fgdbm_fetch(obj, argv[i]));
|
||||
rb_ary_push(new, rb_gdbm_fetch3(obj, argv[i]));
|
||||
}
|
||||
|
||||
return new;
|
||||
|
@ -579,7 +591,7 @@ static VALUE
|
|||
fgdbm_empty_p(obj)
|
||||
VALUE obj;
|
||||
{
|
||||
datum key;
|
||||
datum key, nextkey;
|
||||
struct dbmdata *dbmp;
|
||||
GDBM_FILE dbm;
|
||||
|
||||
|
|
|
@ -18,6 +18,7 @@ static VALUE mReadline;
|
|||
#ifndef READLINE_42_OR_LATER
|
||||
# define rl_filename_completion_function filename_completion_function
|
||||
# define rl_username_completion_function username_completion_function
|
||||
# define rl_completion_matches completion_matches
|
||||
#endif
|
||||
|
||||
static int
|
||||
|
@ -326,8 +327,8 @@ filename_completion_proc_call(self, str)
|
|||
char **matches;
|
||||
int i;
|
||||
|
||||
matches = completion_matches(STR2CSTR(str),
|
||||
rl_filename_completion_function);
|
||||
matches = rl_completion_matches(STR2CSTR(str),
|
||||
rl_filename_completion_function);
|
||||
if (matches) {
|
||||
result = rb_ary_new();
|
||||
for (i = 0; matches[i]; i++) {
|
||||
|
@ -353,8 +354,8 @@ username_completion_proc_call(self, str)
|
|||
char **matches;
|
||||
int i;
|
||||
|
||||
matches = completion_matches(STR2CSTR(str),
|
||||
rl_username_completion_function);
|
||||
matches = rl_completion_matches(STR2CSTR(str),
|
||||
rl_username_completion_function);
|
||||
if (matches) {
|
||||
result = rb_ary_new();
|
||||
for (i = 0; matches[i]; i++) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue