mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* dir.c (dir_inspect, dir_path, dir_tell): check for frozen and closed
is not needed. [ruby-dev:32640] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14337 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
a329b77348
commit
94e82d6c65
2 changed files with 11 additions and 6 deletions
|
@ -1,3 +1,8 @@
|
|||
Wed Dec 19 23:57:37 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||
|
||||
* dir.c (dir_inspect, dir_path, dir_tell): check for frozen and closed
|
||||
is not needed. [ruby-dev:32640]
|
||||
|
||||
Wed Dec 19 22:59:52 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
|
||||
|
||||
* string.c (str_sublen): adjust position if position is not at the
|
||||
|
|
12
dir.c
12
dir.c
|
@ -268,7 +268,7 @@ fnmatch_helper(
|
|||
const char *t;
|
||||
if (ISEND(s))
|
||||
RETURN(FNM_NOMATCH);
|
||||
if (t = bracket(p + 1, s, flags)) {
|
||||
if ((t = bracket(p + 1, s, flags)) != 0) {
|
||||
p = t;
|
||||
Inc(s);
|
||||
continue;
|
||||
|
@ -465,7 +465,7 @@ dir_inspect(VALUE dir)
|
|||
{
|
||||
struct dir_data *dirp;
|
||||
|
||||
GetDIR(dir, dirp);
|
||||
Data_Get_Struct(dir, struct dir_data, dirp);
|
||||
if (dirp->path) {
|
||||
char *c = rb_obj_classname(dir);
|
||||
int len = strlen(c) + strlen(dirp->path) + 4;
|
||||
|
@ -490,7 +490,7 @@ dir_path(VALUE dir)
|
|||
{
|
||||
struct dir_data *dirp;
|
||||
|
||||
GetDIR(dir, dirp);
|
||||
Data_Get_Struct(dir, struct dir_data, dirp);
|
||||
if (!dirp->path) return Qnil;
|
||||
return rb_str_new2(dirp->path);
|
||||
}
|
||||
|
@ -581,7 +581,7 @@ dir_tell(VALUE dir)
|
|||
struct dir_data *dirp;
|
||||
long pos;
|
||||
|
||||
GetDIR(dir, dirp);
|
||||
Data_Get_Struct(dir, struct dir_data, dirp);
|
||||
pos = telldir(dirp->dir);
|
||||
return rb_int2inum(pos);
|
||||
#else
|
||||
|
@ -976,7 +976,7 @@ has_magic(const char *s, int flags)
|
|||
register const char *p = s;
|
||||
register char c;
|
||||
|
||||
while (c = *p++) {
|
||||
while ((c = *p++) != 0) {
|
||||
switch (c) {
|
||||
case '*':
|
||||
case '?':
|
||||
|
@ -1009,7 +1009,7 @@ find_dirsep(const char *s, int flags)
|
|||
register char c;
|
||||
int open = 0;
|
||||
|
||||
while (c = *p++) {
|
||||
while ((c = *p++) != 0) {
|
||||
switch (c) {
|
||||
case '[':
|
||||
open = 1;
|
||||
|
|
Loading…
Reference in a new issue