mirror of
				https://github.com/ruby/ruby.git
				synced 2022-11-09 12:17:21 -05:00 
			
		
		
		
	* 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
This commit is contained in:
		
							parent
							
								
									a727cf52cc
								
							
						
					
					
						commit
						b105d85690
					
				
					 2 changed files with 8 additions and 5 deletions
				
			
		| 
						 | 
					@ -1,3 +1,7 @@
 | 
				
			||||||
 | 
					Thu Oct  7 02:56:43 2004  Nobuyoshi Nakada  <nobu@ruby-lang.org>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						* ext/stringio/stringio.c: use FMODE_APPEND.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
Thu Oct  7 01:05:33 2004  Hidetoshi NAGAI  <nagai@ai.kyutech.ac.jp>
 | 
					Thu Oct  7 01:05:33 2004  Hidetoshi NAGAI  <nagai@ai.kyutech.ac.jp>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	* ext/tk/lib/tk.rb: add Tk.errorInfo and Tk.errorCode
 | 
						* ext/tk/lib/tk.rb: add Tk.errorInfo and Tk.errorCode
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -15,8 +15,7 @@
 | 
				
			||||||
#include "ruby.h"
 | 
					#include "ruby.h"
 | 
				
			||||||
#include "rubyio.h"
 | 
					#include "rubyio.h"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#define STRIO_APPEND 4
 | 
					#define STRIO_EOF FMODE_SYNC
 | 
				
			||||||
#define STRIO_EOF 8
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
struct StringIO {
 | 
					struct StringIO {
 | 
				
			||||||
    VALUE string;
 | 
					    VALUE string;
 | 
				
			||||||
| 
						 | 
					@ -220,7 +219,7 @@ strio_initialize(argc, argv, self)
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
	switch (*m) {
 | 
						switch (*m) {
 | 
				
			||||||
	  case 'a':
 | 
						  case 'a':
 | 
				
			||||||
	    ptr->flags |= STRIO_APPEND;
 | 
						    ptr->flags |= FMODE_APPEND;
 | 
				
			||||||
	    break;
 | 
						    break;
 | 
				
			||||||
	  case 'w':
 | 
						  case 'w':
 | 
				
			||||||
	    rb_str_resize(string, 0);
 | 
						    rb_str_resize(string, 0);
 | 
				
			||||||
| 
						 | 
					@ -779,7 +778,7 @@ strio_write(self, str)
 | 
				
			||||||
    if (!len) return INT2FIX(0);
 | 
					    if (!len) return INT2FIX(0);
 | 
				
			||||||
    check_modifiable(ptr);
 | 
					    check_modifiable(ptr);
 | 
				
			||||||
    olen = RSTRING(ptr->string)->len;
 | 
					    olen = RSTRING(ptr->string)->len;
 | 
				
			||||||
    if (ptr->flags & STRIO_APPEND) {
 | 
					    if (ptr->flags & FMODE_APPEND) {
 | 
				
			||||||
	ptr->pos = olen;
 | 
						ptr->pos = olen;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    if (ptr->pos == olen) {
 | 
					    if (ptr->pos == olen) {
 | 
				
			||||||
| 
						 | 
					@ -814,7 +813,7 @@ strio_putc(self, ch)
 | 
				
			||||||
    int c = NUM2CHR(ch);
 | 
					    int c = NUM2CHR(ch);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    check_modifiable(ptr);
 | 
					    check_modifiable(ptr);
 | 
				
			||||||
    if (ptr->flags & STRIO_APPEND) {
 | 
					    if (ptr->flags & FMODE_APPEND) {
 | 
				
			||||||
	ptr->pos = RSTRING(ptr->string)->len;
 | 
						ptr->pos = RSTRING(ptr->string)->len;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    if (ptr->pos >= RSTRING(ptr->string)->len) {
 | 
					    if (ptr->pos >= RSTRING(ptr->string)->len) {
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue