summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYukihiro Matsumoto <matz@ruby-lang.org>1997-12-04 14:29:59 +0900
committerTakashi Kokubun <takashikkbn@gmail.com>2019-08-17 22:09:33 +0900
commitfb0fe24512d1796f794306768ddac37566e9a209 (patch)
tree441fc10b147be3cc7db217ab1d64ec1ff4dbf7ff
parentab261638f5b87384fa2bda5678cb38ae9a505209 (diff)
version 1.0-971204v1_0_971204
https://cache.ruby-lang.org/pub/ruby/1.0/ruby-1.0-971204.tar.gz Thu Dec 4 14:29:59 1997 Yukihiro Matsumoto <matz@netlab.co.jp> * version 1.0-971204 Mon Dec 1 15:24:41 1997 Yukihiro Matsumoto <matz@netlab.co.jp> * compar.c (cmp_between): wrong comparison made. Wed Nov 26 18:18:05 1997 Yukihiro Matsumoto <matz@netlab.co.jp> * numeric.c (fix2str): enlarge buffer to prevent overflow on some machines.
-rw-r--r--ChangeLog13
-rw-r--r--compar.c2
-rw-r--r--ext/curses/curses.c185
-rw-r--r--ext/curses/extconf.rb2
-rw-r--r--ext/extmk.rb.in16
-rw-r--r--io.c2
-rw-r--r--lib/tkcanvas.rb2
-rw-r--r--missing/nt.c14
-rw-r--r--string.c4
-rw-r--r--time.c4
-rw-r--r--version.h4
11 files changed, 177 insertions, 71 deletions
diff --git a/ChangeLog b/ChangeLog
index 20cf65f4aa..843728a75f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,16 @@
+Thu Dec 4 14:29:59 1997 Yukihiro Matsumoto <matz@netlab.co.jp>
+
+ * version 1.0-971204
+
+Mon Dec 1 15:24:41 1997 Yukihiro Matsumoto <matz@netlab.co.jp>
+
+ * compar.c (cmp_between): wrong comparison made.
+
+Wed Nov 26 18:18:05 1997 Yukihiro Matsumoto <matz@netlab.co.jp>
+
+ * numeric.c (fix2str): enlarge buffer to prevent overflow on some
+ machines.
+
Tue Nov 25 15:03:28 1997 Yukihiro Matsumoto <matz@netlab.co.jp>
* version 1.0-971125
diff --git a/compar.c b/compar.c
index 1301121f14..b3cfac2c69 100644
--- a/compar.c
+++ b/compar.c
@@ -79,7 +79,7 @@ cmp_between(x, min, max)
int t = NUM2INT(c);
if (t < 0) return FALSE;
- c = rb_funcall(x, cmp, 1, min);
+ c = rb_funcall(x, cmp, 1, max);
t = NUM2INT(c);
if (t > 0) return FALSE;
return TRUE;
diff --git a/ext/curses/curses.c b/ext/curses/curses.c
index 16ba90cff0..6e8e49684f 100644
--- a/ext/curses/curses.c
+++ b/ext/curses/curses.c
@@ -55,14 +55,17 @@ curses_err()
#define CHECK(c) if ((c)==ERR) {curses_err();}
static void
-free_window(struct windata *winp)
+free_window(winp)
+ struct windata *winp;
{
if (winp->window && winp->window != stdscr) delwin(winp->window);
winp->window = 0;
}
static VALUE
-prep_window(VALUE class, WINDOW *window)
+prep_window(class, window)
+ VALUE class;
+ WINDOW *window;
{
VALUE obj;
struct windata *winp;
@@ -124,7 +127,8 @@ curses_closed()
/* def clear */
static VALUE
-curses_clear(VALUE obj)
+curses_clear(obj)
+ VALUE obj;
{
wclear(stdscr);
return Qnil;
@@ -132,7 +136,8 @@ curses_clear(VALUE obj)
/* def refresh */
static VALUE
-curses_refresh(VALUE obj)
+curses_refresh(obj)
+ VALUE obj;
{
CHECK(refresh());
return Qnil;
@@ -140,7 +145,8 @@ curses_refresh(VALUE obj)
/* def refresh */
static VALUE
-curses_doupdate(VALUE obj)
+curses_doupdate(obj)
+ VALUE obj;
{
CHECK(doupdate());
return Qnil;
@@ -148,7 +154,8 @@ curses_doupdate(VALUE obj)
/* def echo */
static VALUE
-curses_echo(VALUE obj)
+curses_echo(obj)
+ VALUE obj;
{
CHECK(echo());
return Qnil;
@@ -156,7 +163,8 @@ curses_echo(VALUE obj)
/* def noecho */
static VALUE
-curses_noecho(VALUE obj)
+curses_noecho(obj)
+ VALUE obj;
{
CHECK(noecho());
return Qnil;
@@ -164,7 +172,8 @@ curses_noecho(VALUE obj)
/* def raw */
static VALUE
-curses_raw(VALUE obj)
+curses_raw(obj)
+ VALUE obj;
{
CHECK(raw());
return Qnil;
@@ -172,7 +181,8 @@ curses_raw(VALUE obj)
/* def noraw */
static VALUE
-curses_noraw(VALUE obj)
+curses_noraw(obj)
+ VALUE obj;
{
CHECK(noraw());
return Qnil;
@@ -180,7 +190,8 @@ curses_noraw(VALUE obj)
/* def cbreak */
static VALUE
-curses_cbreak(VALUE obj)
+curses_cbreak(obj)
+ VALUE obj;
{
CHECK(cbreak());
return Qnil;
@@ -188,7 +199,8 @@ curses_cbreak(VALUE obj)
/* def nocbreak */
static VALUE
-curses_nocbreak(VALUE obj)
+curses_nocbreak(obj)
+ VALUE obj;
{
CHECK(nocbreak());
return Qnil;
@@ -196,7 +208,8 @@ curses_nocbreak(VALUE obj)
/* def nl */
static VALUE
-curses_nl(VALUE obj)
+curses_nl(obj)
+ VALUE obj;
{
CHECK(nl());
return Qnil;
@@ -204,7 +217,8 @@ curses_nl(VALUE obj)
/* def nonl */
static VALUE
-curses_nonl(VALUE obj)
+curses_nonl(obj)
+ VALUE obj;
{
CHECK(nonl());
return Qnil;
@@ -212,7 +226,8 @@ curses_nonl(VALUE obj)
/* def beep */
static VALUE
-curses_beep(VALUE obj)
+curses_beep(obj)
+ VALUE obj;
{
#ifdef HAVE_BEEP
beep();
@@ -222,7 +237,8 @@ curses_beep(VALUE obj)
/* def flash */
static VALUE
-curses_flash(VALUE obj)
+curses_flash(obj)
+ VALUE obj;
{
flash();
return Qnil;
@@ -230,7 +246,9 @@ curses_flash(VALUE obj)
/* def ungetch */
static VALUE
-curses_ungetch(VALUE obj, VALUE ch)
+curses_ungetch(obj, ch)
+ VALUE obj;
+ VALUE ch;
{
#ifdef HAVE_UNGETCH
CHECK(ungetch(NUM2INT(ch)));
@@ -242,7 +260,10 @@ curses_ungetch(VALUE obj, VALUE ch)
/* def setpos(y, x) */
static VALUE
-curses_setpos(VALUE obj, VALUE y, VALUE x)
+curses_setpos(obj, y, x)
+ VALUE obj;
+ VALUE y;
+ VALUE x;
{
CHECK(move(NUM2INT(y), NUM2INT(x)));
return Qnil;
@@ -250,7 +271,8 @@ curses_setpos(VALUE obj, VALUE y, VALUE x)
/* def standout */
static VALUE
-curses_standout(VALUE obj)
+curses_standout(obj)
+ VALUE obj;
{
standout();
return Qnil;
@@ -258,7 +280,8 @@ curses_standout(VALUE obj)
/* def standend */
static VALUE
-curses_standend(VALUE obj)
+curses_standend(obj)
+ VALUE obj;
{
standend();
return Qnil;
@@ -266,14 +289,17 @@ curses_standend(VALUE obj)
/* def inch */
static VALUE
-curses_inch(VALUE obj)
+curses_inch(obj)
+ VALUE obj;
{
return CHAR2FIX(inch());
}
/* def addch(ch) */
static VALUE
-curses_addch(VALUE obj, VALUE ch)
+curses_addch(obj, ch)
+ VALUE obj;
+ VALUE ch;
{
CHECK(addch(NUM2CHAR(ch)));
return Qnil;
@@ -281,7 +307,9 @@ curses_addch(VALUE obj, VALUE ch)
/* def insch(ch) */
static VALUE
-curses_insch(VALUE obj, VALUE ch)
+curses_insch(obj, ch)
+ VALUE obj;
+ VALUE ch;
{
CHECK(insch(NUM2CHAR(ch)));
return Qnil;
@@ -289,7 +317,9 @@ curses_insch(VALUE obj, VALUE ch)
/* def addstr(str) */
static VALUE
-curses_addstr(VALUE obj, VALUE str)
+curses_addstr(obj, str)
+ VALUE obj;
+ VALUE str;
{
addstr(RSTRING(str)->ptr);
return Qnil;
@@ -297,14 +327,16 @@ curses_addstr(VALUE obj, VALUE str)
/* def getch */
static VALUE
-curses_getch(VALUE obj)
+curses_getch(obj)
+ VALUE obj;
{
return CHAR2FIX(getch());
}
/* def getstr */
static VALUE
-curses_getstr(VALUE obj)
+curses_getstr(obj)
+ VALUE obj;
{
char rtn[1024]; /* This should be big enough.. I hope */
CHECK(getstr(rtn));
@@ -313,7 +345,8 @@ curses_getstr(VALUE obj)
/* def delch */
static VALUE
-curses_delch(VALUE obj)
+curses_delch(obj)
+ VALUE obj;
{
CHECK(delch());
return Qnil;
@@ -321,7 +354,8 @@ curses_delch(VALUE obj)
/* def delelteln */
static VALUE
-curses_deleteln(VALUE obj)
+curses_deleteln(obj)
+ VALUE obj;
{
CHECK(deleteln());
return Qnil;
@@ -343,9 +377,12 @@ curses_cols()
/* def new(lines, cols, top, left) */
static VALUE
-window_s_new(VALUE class,
- VALUE lines, VALUE cols,
- VALUE top, VALUE left)
+window_s_new(class, lines, cols, top, left)
+ VALUE class;
+ VALUE lines;
+ VALUE cols;
+ VALUE top;
+ VALUE left;
{
WINDOW *window;
@@ -356,9 +393,12 @@ window_s_new(VALUE class,
/* def subwin(lines, cols, top, left) */
static VALUE
-window_subwin(VALUE obj,
- VALUE lines, VALUE cols,
- VALUE top, VALUE left)
+window_subwin(obj, lines, cols, top, left)
+ VALUE obj;
+ VALUE lines;
+ VALUE cols;
+ VALUE top;
+ VALUE left;
{
struct windata *winp;
WINDOW *window;
@@ -371,7 +411,8 @@ window_subwin(VALUE obj,
/* def close */
static VALUE
-window_close(VALUE obj)
+window_close(obj)
+ VALUE obj;
{
struct windata *winp;
@@ -383,7 +424,8 @@ window_close(VALUE obj)
/* def clear */
static VALUE
-window_clear(VALUE obj)
+window_clear(obj)
+ VALUE obj;
{
struct windata *winp;
@@ -395,7 +437,8 @@ window_clear(VALUE obj)
/* def refresh */
static VALUE
-window_refresh(VALUE obj)
+window_refresh(obj)
+ VALUE obj;
{
struct windata *winp;
@@ -407,7 +450,10 @@ window_refresh(VALUE obj)
/* def box(vert, hor) */
static VALUE
-window_box(VALUE obj, VALUE vert, VALUE hor)
+window_box(obj, vert, hor)
+ VALUE obj;
+ VALUE vert;
+ VALUE hor;
{
struct windata *winp;
@@ -420,7 +466,10 @@ window_box(VALUE obj, VALUE vert, VALUE hor)
/* def move(y, x) */
static VALUE
-window_move(VALUE obj, VALUE y, VALUE x)
+window_move(obj, y, x)
+ VALUE obj;
+ VALUE y;
+ VALUE x;
{
struct windata *winp;
@@ -432,7 +481,10 @@ window_move(VALUE obj, VALUE y, VALUE x)
/* def setpos(y, x) */
static VALUE
-window_setpos(VALUE obj, VALUE y, VALUE x)
+window_setpos(obj, y, x)
+ VALUE obj;
+ VALUE y;
+ VALUE x;
{
struct windata *winp;
@@ -443,7 +495,8 @@ window_setpos(VALUE obj, VALUE y, VALUE x)
/* def cury */
static VALUE
-window_cury(VALUE obj)
+window_cury(obj)
+ VALUE obj;
{
struct windata *winp;
int x, y;
@@ -455,7 +508,8 @@ window_cury(VALUE obj)
/* def curx */
static VALUE
-window_curx(VALUE obj)
+window_curx(obj)
+ VALUE obj;
{
struct windata *winp;
int x, y;
@@ -467,7 +521,8 @@ window_curx(VALUE obj)
/* def maxy */
static VALUE
-window_maxy(VALUE obj)
+window_maxy(obj)
+ VALUE obj;
{
struct windata *winp;
int x, y;
@@ -487,7 +542,8 @@ window_maxy(VALUE obj)
/* def maxx */
static VALUE
-window_maxx(VALUE obj)
+window_maxx(obj)
+ VALUE obj;
{
struct windata *winp;
int x, y;
@@ -507,7 +563,8 @@ window_maxx(VALUE obj)
/* def begy */
static VALUE
-window_begy(VALUE obj)
+window_begy(obj)
+ VALUE obj;
{
struct windata *winp;
int x, y;
@@ -523,7 +580,8 @@ window_begy(VALUE obj)
/* def begx */
static VALUE
-window_begx(VALUE obj)
+window_begx(obj)
+ VALUE obj;
{
struct windata *winp;
int x, y;
@@ -539,7 +597,8 @@ window_begx(VALUE obj)
/* def standout */
static VALUE
-window_standout(VALUE obj)
+window_standout(obj)
+ VALUE obj;
{
struct windata *winp;
@@ -550,7 +609,8 @@ window_standout(VALUE obj)
/* def standend */
static VALUE
-window_standend(VALUE obj)
+window_standend(obj)
+ VALUE obj;
{
struct windata *winp;
@@ -561,7 +621,8 @@ window_standend(VALUE obj)
/* def inch */
static VALUE
-window_inch(VALUE obj)
+window_inch(obj)
+ VALUE obj;
{
struct windata *winp;
@@ -571,7 +632,9 @@ window_inch(VALUE obj)
/* def addch(ch) */
static VALUE
-window_addch(VALUE obj, VALUE ch)
+window_addch(obj, ch)
+ VALUE obj;
+ VALUE ch;
{
struct windata *winp;
@@ -583,7 +646,9 @@ window_addch(VALUE obj, VALUE ch)
/* def insch(ch) */
static VALUE
-window_insch(VALUE obj, VALUE ch)
+window_insch(obj, ch)
+ VALUE obj;
+ VALUE ch;
{
struct windata *winp;
@@ -595,7 +660,9 @@ window_insch(VALUE obj, VALUE ch)
/* def addstr(str) */
static VALUE
-window_addstr(VALUE obj, VALUE str)
+window_addstr(obj, str)
+ VALUE obj;
+ VALUE str;
{
struct windata *winp;
@@ -607,7 +674,9 @@ window_addstr(VALUE obj, VALUE str)
/* def <<(str) */
static VALUE
-window_addstr2(VALUE obj, VALUE str)
+window_addstr2(obj, str)
+ VALUE obj;
+ VALUE str;
{
window_addstr(obj, str);
return obj;
@@ -615,7 +684,8 @@ window_addstr2(VALUE obj, VALUE str)
/* def getch */
static VALUE
-window_getch(VALUE obj)
+window_getch(obj)
+ VALUE obj;
{
struct windata *winp;
@@ -625,7 +695,8 @@ window_getch(VALUE obj)
/* def getstr */
static VALUE
-window_getstr(VALUE obj)
+window_getstr(obj)
+ VALUE obj;
{
struct windata *winp;
char rtn[1024]; /* This should be big enough.. I hope */
@@ -637,7 +708,8 @@ window_getstr(VALUE obj)
/* def delch */
static VALUE
-window_delch(VALUE obj)
+window_delch(obj)
+ VALUE obj;
{
struct windata *winp;
@@ -648,7 +720,8 @@ window_delch(VALUE obj)
/* def delelteln */
static VALUE
-window_deleteln(VALUE obj)
+window_deleteln(obj)
+ VALUE obj;
{
struct windata *winp;
diff --git a/ext/curses/extconf.rb b/ext/curses/extconf.rb
index 22b1e2f0cc..9b28437843 100644
--- a/ext/curses/extconf.rb
+++ b/ext/curses/extconf.rb
@@ -7,7 +7,7 @@ elsif have_header("ncurses/curses.h") and have_library("ncurses", "initscr")
make=TRUE
else
$CFLAGS=nil
- have_library("termcap", "tparam")
+ have_library("termcap", "tgetent")
if have_library("curses", "initscr")
make=TRUE
end
diff --git a/ext/extmk.rb.in b/ext/extmk.rb.in
index 16f8708abb..78fe3070a2 100644
--- a/ext/extmk.rb.in
+++ b/ext/extmk.rb.in
@@ -224,9 +224,12 @@ LDSHARED = @LDSHARED@
mfile.printf "\
+program_transform_name = -e @program_transform_name@
+RUBY_INSTALL_NAME = `t='$(program_transform_name)'; echo ruby | sed $$t`
+
prefix = @prefix@
exec_prefix = @exec_prefix@
-libdir = @libdir@/ruby/@arch@
+libdir = @libdir@/$(RUBY_INSTALL_NAME)/@arch@
@SET_MAKE@
#### End of system configuration section. ####
@@ -264,9 +267,7 @@ realclean: clean
if !$static
mfile.printf "\
-install: $(libdir)/$(TARGET)
-
-$(libdir)/$(TARGET): $(TARGET)
+install:
@test -d $(libdir) || mkdir $(libdir)
$(INSTALL) $(TARGET) $(libdir)/$(TARGET)
"
@@ -293,8 +294,13 @@ $(TARGET): $(OBJS)
$(TARGET): $(OBJS)
cc -r $(CFLAGS) -o $(TARGET) $(OBJS)
"
+ elsif $static
+ mfile.printf "\
+$(TARGET): $(OBJS)
+ ld -r -o $(TARGET) $(OBJS)
+"
else
- mfile.printf "\
+ mfile.printf "\
$(TARGET): $(OBJS)
ld $(DLDFLAGS) -r -o $(TARGET) $(OBJS)
"
diff --git a/io.c b/io.c
index f6c0f89ca6..d74337ffb5 100644
--- a/io.c
+++ b/io.c
@@ -880,7 +880,7 @@ io_unbuffered(fptr)
OpenFile *fptr;
{
if (fptr->f2 == 0) TypeError("non-writable fptr");
- setbuf(fptr->f, NULL);
+ if (fptr->f != 0) setbuf(fptr->f, NULL);
setbuf(fptr->f2, NULL);
fptr->mode |= FMODE_SYNC;
}
diff --git a/lib/tkcanvas.rb b/lib/tkcanvas.rb
index 46acd8c9d7..26f0ac0c7b 100644
--- a/lib/tkcanvas.rb
+++ b/lib/tkcanvas.rb
@@ -93,7 +93,7 @@ class TkCanvas<TkWindow
tk_send 'type', tagid(tag)
end
def postscript(keys=None)
- tk_call "pack", *hash_kv(keys)
+ tk_send "postscript", *hash_kv(keys)
end
def raise(tag, above=None)
tk_send 'raise', tagid(tag), above
diff --git a/missing/nt.c b/missing/nt.c
index 58736ae241..b96ac93340 100644
--- a/missing/nt.c
+++ b/missing/nt.c
@@ -491,6 +491,20 @@ mypopen (char *cmd, char *mode)
sa.lpSecurityDescriptor = NULL;
sa.bInheritHandle = TRUE;
+ if (!reading) {
+ FILE *fp;
+
+ fp = (_popen)(cmd, mode);
+
+ MyPopenRecord[slot].inuse = TRUE;
+ MyPopenRecord[slot].pipe = fp;
+ MyPopenRecord[slot].pid = -1;
+
+ if (!fp)
+ Fatal("cannot open pipe \"%s\" (%s)", cmd, strerror(errno));
+ return fp;
+ }
+
fRet = CreatePipe(&hInFile, &hOutFile, &sa, 2048L);
if (!fRet)
Fatal("cannot open pipe \"%s\" (%s)", cmd, strerror(errno));
diff --git a/string.c b/string.c
index a9f3fc5ab0..7f1fae775e 100644
--- a/string.c
+++ b/string.c
@@ -682,12 +682,12 @@ str_aref(str, indx)
return (VALUE)INT2FIX(str->ptr[idx] & 0xff);
case T_REGEXP:
- if (str_index(str, indx))
+ if (str_match(str, indx))
return reg_last_match(0);
return Qnil;
case T_STRING:
- if (str_index(str, indx, 0)) return indx;
+ if (str_index(str, indx, 0) != -1) return indx;
return Qnil;
default:
diff --git a/time.c b/time.c
index c5147a47a8..408a8608a8 100644
--- a/time.c
+++ b/time.c
@@ -445,10 +445,10 @@ time_coerce(time1, time2)
double d = RFLOAT(time2)->value;
unsigned int i = (unsigned int) d;
- return time_new_internal(i, (int)(d - (double)i)*1e6);
+ return assoc_new(time_new(i, (int)((d - (double)i)*1e6)),time1);
}
- return time_new(CLASS_OF(time1), NUM2INT(time2), 0);
+ return assoc_new(time_new(NUM2INT(time2), 0), time1);
}
static VALUE
diff --git a/version.h b/version.h
index ae1a0cda4a..da4280c037 100644
--- a/version.h
+++ b/version.h
@@ -1,2 +1,2 @@
-#define RUBY_VERSION "1.0-971125"
-#define VERSION_DATE "97/11/25"
+#define RUBY_VERSION "1.0-971204"
+#define VERSION_DATE "97/12/04"