summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog5
-rw-r--r--dir.c12
2 files changed, 11 insertions, 6 deletions
diff --git a/ChangeLog b/ChangeLog
index f188d85..5441d06 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Wed Mar 19 21:01:08 2008 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 Mar 19 20:25:40 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
* dir.c (Init_Dir): define inspect method. [ruby-core:15960]
diff --git a/dir.c b/dir.c
index 684e5a0..b61e7c1 100644
--- a/dir.c
+++ b/dir.c
@@ -268,7 +268,7 @@ fnmatch_helper(pcur, scur, flags)
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;
@@ -473,7 +473,7 @@ dir_inspect(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;
@@ -499,7 +499,7 @@ dir_path(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);
}
@@ -592,7 +592,7 @@ dir_tell(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
@@ -1008,7 +1008,7 @@ has_magic(s, flags)
register const char *p = s;
register char c;
- while (c = *p++) {
+ while ((c = *p++) != 0) {
switch (c) {
case '*':
case '?':
@@ -1041,7 +1041,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;