diff --git a/ChangeLog b/ChangeLog index 70fd197f35..7a7ce4d673 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +Tue Jan 6 01:01:04 2004 NAKAMURA Usaku + + * win32/dir.h, win32/win32.c: fix patch miss. + + * win32/Makefile.sub: fix file dependency. + Mon Jan 5 20:32:00 2004 Gavin Sinclair * lib/logger.rb: enhanced documentation. diff --git a/win32/Makefile.sub b/win32/Makefile.sub index ddbd3e08a9..e9fb463f9f 100644 --- a/win32/Makefile.sub +++ b/win32/Makefile.sub @@ -572,7 +572,7 @@ compar.obj: {$(srcdir)}compar.c {$(srcdir)}ruby.h config.h \ {$(srcdir)}/win32/win32.h dir.obj: {$(srcdir)}dir.c {$(srcdir)}ruby.h config.h \ {$(srcdir)}defines.h {$(srcdir)}intern.h {$(srcdir)}missing.h \ - {$(srcdir)}util.h {$(srcdir)}/win32/win32.h + {$(srcdir)}util.h {$(srcdir)}/win32/win32.h {$(srcdir)}/win32/dir.h dln.obj: {$(srcdir)}dln.c {$(srcdir)}ruby.h config.h \ {$(srcdir)}defines.h {$(srcdir)}intern.h {$(srcdir)}missing.h \ {$(srcdir)}dln.h {$(srcdir)}/win32/win32.h diff --git a/win32/dir.h b/win32/dir.h index 8345e346b3..1f1f66649a 100644 --- a/win32/dir.h +++ b/win32/dir.h @@ -12,18 +12,15 @@ struct direct char d_name[256]; char d_isdir; /* directory */ char d_isrep; /* reparse point */ - char d_isdir; }; typedef struct { char *start; char *curr; long size; long nfiles; + struct direct dirstr; char *bits; /* used for d_isdir and d_isrep */ long bitpos; /* used for d_isdir and d_isrep */ - struct direct dirstr; - char *bits; - long bitpos; } DIR; diff --git a/win32/win32.c b/win32/win32.c index d592ba6b8b..b1b55d34e1 100644 --- a/win32/win32.c +++ b/win32/win32.c @@ -1393,8 +1393,6 @@ rb_w32_opendir(const char *filename) SetBit(p->bits, 0); if (fd.dwFileAttributes & FILE_ATTRIBUTE_REPARSE_POINT) SetBit(p->bits, 1); - p->bits = ALLOC_N(char, 1); - p->bits[0] = fd.attrib & _A_SUBDIR ? 1 : 0; p->nfiles++; // @@ -1431,18 +1429,6 @@ rb_w32_opendir(const char *filename) if (fd.dwFileAttributes & FILE_ATTRIBUTE_REPARSE_POINT) SetBit(p->bits, p->nfiles * 2 + 1); - - if (p->nfiles % 8 == 0) { - Renew (p->bits, p->nfiles / 8 + 1, char); - if (p->bits == NULL) { - rb_fatal ("opendir: malloc failed!\n"); - } - p->bits[p->nfiles / 8] = 0; - } - if (fd.attrib & _A_SUBDIR) { - p->bits[p->nfiles / 8] |= (1 << p->nfiles % 8); - } - p->nfiles++; idx += len+1; } @@ -1479,12 +1465,6 @@ rb_w32_readdir(DIR *dirp) // dirp->dirstr.d_ino = dummy++; - // - // Directory flag - // - dirp->dirstr.d_isdir = dirp->bits[dirp->bitpos / 8] & (1 << dirp->bitpos % 8); - dirp->bitpos++; - // // Attributes // @@ -1537,7 +1517,6 @@ rb_w32_rewinddir(DIR *dirp) { dirp->curr = dirp->start; dirp->bitpos = 0; - dirp->bitpos = 0; } // @@ -1547,7 +1526,6 @@ rb_w32_rewinddir(DIR *dirp) void rb_w32_closedir(DIR *dirp) { - free(dirp->bits); free(dirp->start); free(dirp->bits); free(dirp);