diff options
| author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2004-10-06 17:57:19 +0000 |
|---|---|---|
| committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2004-10-06 17:57:19 +0000 |
| commit | e2557be11bb81855fde054d550c727fef85eb872 (patch) | |
| tree | fbc8acc032349cfb64bc6308f22c4932d7786542 /ext/stringio/stringio.c | |
| parent | 6bf9ece91864715512d79756017221aae0305d71 (diff) | |
| download | ruby-e2557be11bb81855fde054d550c727fef85eb872.tar.gz ruby-e2557be11bb81855fde054d550c727fef85eb872.tar.xz ruby-e2557be11bb81855fde054d550c727fef85eb872.zip | |
* ext/stringio/stringio.c: use FMODE_APPEND.
git-svn-id: http://svn.ruby-lang.org/repos/ruby/branches/ruby_1_8@7008 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/stringio/stringio.c')
| -rw-r--r-- | ext/stringio/stringio.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/ext/stringio/stringio.c b/ext/stringio/stringio.c index 98376d06f..790e56760 100644 --- a/ext/stringio/stringio.c +++ b/ext/stringio/stringio.c @@ -15,8 +15,7 @@ #include "ruby.h" #include "rubyio.h" -#define STRIO_APPEND 4 -#define STRIO_EOF 8 +#define STRIO_EOF FMODE_SYNC struct StringIO { VALUE string; @@ -220,7 +219,7 @@ strio_initialize(argc, argv, self) } switch (*m) { case 'a': - ptr->flags |= STRIO_APPEND; + ptr->flags |= FMODE_APPEND; break; case 'w': rb_str_resize(string, 0); @@ -779,7 +778,7 @@ strio_write(self, str) if (!len) return INT2FIX(0); check_modifiable(ptr); olen = RSTRING(ptr->string)->len; - if (ptr->flags & STRIO_APPEND) { + if (ptr->flags & FMODE_APPEND) { ptr->pos = olen; } if (ptr->pos == olen) { @@ -814,7 +813,7 @@ strio_putc(self, ch) int c = NUM2CHR(ch); check_modifiable(ptr); - if (ptr->flags & STRIO_APPEND) { + if (ptr->flags & FMODE_APPEND) { ptr->pos = RSTRING(ptr->string)->len; } if (ptr->pos >= RSTRING(ptr->string)->len) { |
