1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* win32/{dir.h,win32.c} (rb_w32_readdir): removed old rb_w32_readdir()

and renamed from rb_w32_readdir_with_enc().
  [ruby-core:24864] [Feature #1927]

* dir.c (READDIR): follow above change.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38534 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
usa 2012-12-21 13:06:17 +00:00
parent 315bf4b6d7
commit 9848f0d0ca
4 changed files with 18 additions and 18 deletions

View file

@ -1,3 +1,11 @@
Fri Dec 21 22:02:00 2012 NAKAMURA Usaku <usa@ruby-lang.org>
* win32/{dir.h,win32.c} (rb_w32_readdir): removed old rb_w32_readdir()
and renamed from rb_w32_readdir_with_enc().
[ruby-core:24864] [Feature #1927]
* dir.c (READDIR): follow above change.
Fri Dec 21 21:12:54 2012 Masaya Tarui <tarui@ruby-lang.org>
* vm_dump.c (rb_vm_bugreport): commentout addr2line call temporarily

2
dir.c
View file

@ -522,7 +522,7 @@ dir_path(VALUE dir)
#if defined HAVE_READDIR_R
# define READDIR(dir, enc, entry, dp) (readdir_r((dir), (entry), &(dp)) == 0 && (dp) != 0)
#elif defined _WIN32
# define READDIR(dir, enc, entry, dp) (((dp) = rb_w32_readdir_with_enc((dir), (enc))) != 0)
# define READDIR(dir, enc, entry, dp) (((dp) = rb_w32_readdir((dir), (enc))) != 0)
#else
# define READDIR(dir, enc, entry, dp) (((dp) = readdir(dir)) != 0)
#endif

View file

@ -29,18 +29,17 @@ typedef struct {
DIR* rb_w32_opendir(const char*);
DIR* rb_w32_uopendir(const char*);
struct direct* rb_w32_readdir(DIR *);
struct direct* rb_w32_readdir_with_enc(DIR *, rb_encoding *);
struct direct* rb_w32_readdir(DIR *, rb_encoding *);
long rb_w32_telldir(DIR *);
void rb_w32_seekdir(DIR *, long);
void rb_w32_rewinddir(DIR *);
void rb_w32_closedir(DIR *);
#define opendir rb_w32_opendir
#define readdir rb_w32_readdir
#define telldir rb_w32_telldir
#define seekdir rb_w32_seekdir
#define rewinddir rb_w32_rewinddir
#define closedir rb_w32_closedir
#define opendir(s) rb_w32_opendir((s))
#define readdir(d) rb_w32_readdir((d), 0)
#define telldir(d) rb_w32_telldir((d))
#define seekdir(d, l) rb_w32_seekdir((d), (l))
#define rewinddir(d) rb_w32_rewinddir((d))
#define closedir(d) rb_w32_closedir((d))
#endif /* RUBY_WIN32_DIR_H */

View file

@ -2025,16 +2025,9 @@ readdir_internal(DIR *dirp, BOOL (*conv)(const WCHAR *, struct direct *, rb_enco
/* License: Ruby's */
struct direct *
rb_w32_readdir(DIR *dirp)
rb_w32_readdir(DIR *dirp, rb_encoding *enc)
{
return readdir_internal(dirp, win32_direct_conv, NULL);
}
/* License: Ruby's */
struct direct *
rb_w32_readdir_with_enc(DIR *dirp, rb_encoding *enc)
{
if (enc == rb_ascii8bit_encoding())
if (!enc || enc == rb_ascii8bit_encoding())
return readdir_internal(dirp, win32_direct_conv, NULL);
else
return readdir_internal(dirp, ruby_direct_conv, enc);