Skip to content

Commit b105d85

Browse files
committed
* ext/stringio/stringio.c: use FMODE_APPEND.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@7008 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
1 parent a727cf5 commit b105d85

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

ChangeLog

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
Thu Oct 7 02:56:43 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
2+
3+
* ext/stringio/stringio.c: use FMODE_APPEND.
4+
15
Thu Oct 7 01:05:33 2004 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
26

37
* ext/tk/lib/tk.rb: add Tk.errorInfo and Tk.errorCode

ext/stringio/stringio.c

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,7 @@
1515
#include "ruby.h"
1616
#include "rubyio.h"
1717

18-
#define STRIO_APPEND 4
19-
#define STRIO_EOF 8
18+
#define STRIO_EOF FMODE_SYNC
2019

2120
struct StringIO {
2221
VALUE string;
@@ -220,7 +219,7 @@ strio_initialize(argc, argv, self)
220219
}
221220
switch (*m) {
222221
case 'a':
223-
ptr->flags |= STRIO_APPEND;
222+
ptr->flags |= FMODE_APPEND;
224223
break;
225224
case 'w':
226225
rb_str_resize(string, 0);
@@ -779,7 +778,7 @@ strio_write(self, str)
779778
if (!len) return INT2FIX(0);
780779
check_modifiable(ptr);
781780
olen = RSTRING(ptr->string)->len;
782-
if (ptr->flags & STRIO_APPEND) {
781+
if (ptr->flags & FMODE_APPEND) {
783782
ptr->pos = olen;
784783
}
785784
if (ptr->pos == olen) {
@@ -814,7 +813,7 @@ strio_putc(self, ch)
814813
int c = NUM2CHR(ch);
815814

816815
check_modifiable(ptr);
817-
if (ptr->flags & STRIO_APPEND) {
816+
if (ptr->flags & FMODE_APPEND) {
818817
ptr->pos = RSTRING(ptr->string)->len;
819818
}
820819
if (ptr->pos >= RSTRING(ptr->string)->len) {

0 commit comments

Comments
 (0)