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

auxiliary routines update.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1898 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
matz 2001-12-10 07:24:00 +00:00
parent 2f8d3bdc21
commit c79368b6a3
2 changed files with 5 additions and 3 deletions

View file

@ -167,7 +167,7 @@ rb_gdbm_fetch(dbm, key)
RSTRING(str)->ptr = 0;
RSTRING(str)->len = val.dsize;
RSTRING(str)->orig = 0;
RSTRING(str)->aux.capa = val.dsize;
RSTRING(str)->ptr = REALLOC_N(val.dptr,char,val.dsize+1);
RSTRING(str)->ptr[val.dsize] = '\0';
@ -214,7 +214,7 @@ rb_gdbm_firstkey(dbm)
RSTRING(str)->ptr = 0;
RSTRING(str)->len = key.dsize;
RSTRING(str)->orig = 0;
RSTRING(str)->aux.capa = key.dsize;
RSTRING(str)->ptr = REALLOC_N(key.dptr,char,key.dsize+1);
RSTRING(str)->ptr[RSTRING(str)->len] = '\0';
@ -238,7 +238,7 @@ rb_gdbm_nextkey(dbm, keystr)
RSTRING(str)->ptr = 0;
RSTRING(str)->len = key2.dsize;
RSTRING(str)->orig = 0;
RSTRING(str)->aux.capa = key2.dsize;
RSTRING(str)->ptr = REALLOC_N(key2.dptr,char,key2.dsize+1);
RSTRING(str)->ptr[RSTRING(str)->len] = '\0';

2
ruby.h
View file

@ -35,6 +35,7 @@ extern "C" {
#include <stdio.h>
/* need to include <ctype.h> to use these macros */
#ifndef ISPRINT
#define ISASCII(c) isascii((unsigned char)(c))
#undef ISPRINT
#define ISPRINT(c) (ISASCII(c) && isprint((unsigned char)(c)))
@ -45,6 +46,7 @@ extern "C" {
#define ISALPHA(c) (ISASCII(c) && isalpha((unsigned char)(c)))
#define ISDIGIT(c) (ISASCII(c) && isdigit((unsigned char)(c)))
#define ISXDIGIT(c) (ISASCII(c) && isxdigit((unsigned char)(c)))
#endif
#if !defined(__STDC__) && !defined(_MSC_VER)
# define volatile