summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>1999-04-13 05:12:04 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>1999-04-13 05:12:04 +0000
commit832ebd2d4d536d03ca86b2f81daa3334376586b3 (patch)
tree201268e9765bbed194b211be760d262502544cb7
parent26f5cdfb3271434e96d4b4e04bbe0e9880ba14bc (diff)
remove strdup
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_3@423 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--parse.y13
1 files changed, 5 insertions, 8 deletions
diff --git a/parse.y b/parse.y
index ca6d833..f4f2772 100644
--- a/parse.y
+++ b/parse.y
@@ -18,7 +18,6 @@
#include "node.h"
#include "st.h"
#include <stdio.h>
-#include <string.h>
#include <errno.h>
/* hack for bison */
@@ -1608,7 +1607,7 @@ none : /* none */
static char *tokenbuf = NULL;
static int tokidx, toksiz = 0;
-#ifndef strdup
+#ifndef HAVE_STRDUP
char *strdup();
#endif
@@ -1722,7 +1721,7 @@ rb_compile_string(f, s, line)
lex_gets_ptr = 0;
lex_input = s;
lex_pbeg = lex_p = lex_pend = 0;
- ruby_sourceline = line;
+ ruby_sourceline = line - 1;
compile_for_eval = 1;
return yycompile(f);
@@ -2072,7 +2071,7 @@ parse_regx(term, paren)
tokfix();
lex_state = EXPR_END;
if (list) {
- nd_set_line(list, re_start-1);
+ nd_set_line(list, re_start);
if (toklen() > 0) {
VALUE ss = rb_str_new(tok(), toklen());
list_append(list, NEW_STR(ss));
@@ -2161,7 +2160,7 @@ parse_string(func, term, paren)
lex_state = EXPR_END;
if (list) {
- nd_set_line(list, strstart-1);
+ nd_set_line(list, strstart);
if (toklen() > 0) {
VALUE ss = rb_str_new(tok(), toklen());
list_append(list, NEW_STR(ss));
@@ -2247,8 +2246,6 @@ parse_quotedword(term, paren)
return tDSTRING;
}
-char *strdup();
-
static int
here_document(term, indent)
char term;
@@ -2365,7 +2362,7 @@ here_document(term, indent)
ruby_sourceline = linesave;
if (list) {
- nd_set_line(list, linesave);
+ nd_set_line(list, linesave+1);
yylval.node = list;
}
switch (term) {