summaryrefslogtreecommitdiff
path: root/dir.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-03-19 12:01:10 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-03-19 12:01:10 +0000
commit5cce095f1181a006b6ef4a5cda678d9f4ace270c (patch)
tree103f74ed14d1d71a1a5b3c91b5a50b3f903d54d5 /dir.c
parent9061c955a89793f491579b05e3e75bd6b28b1d2c (diff)
* 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/branches/ruby_1_8@15806 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'dir.c')
-rw-r--r--dir.c12
1 files changed, 6 insertions, 6 deletions
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;