summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2002-09-25 14:52:37 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2002-09-25 14:52:37 +0000
commit12852c2e9ad0b25395d32c4ee147eb770408cf41 (patch)
treeadfa0f16338897148efd66dbfda189e44b9696b2
parent44b2f1609ca6a4732066c70f06499e46ab5b6bf9 (diff)
* dir.c (glob_helper): must not closedir() when exception raised
while globbing "**". * marshal.c (w_uclass): unused variable. * re.c (match_clone): unused. * regex.c (re_compile_pattern): get rid of implicit promotion from plain char to int. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2890 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog14
-rw-r--r--dir.c6
-rw-r--r--marshal.c1
-rw-r--r--re.c17
-rw-r--r--regex.c8
5 files changed, 20 insertions, 26 deletions
diff --git a/ChangeLog b/ChangeLog
index 11d4357dd6..303900fbad 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,15 @@
+Wed Sep 25 23:51:29 2002 Nobuyoshi Nakada <nobu.nokada@softhome.net>
+
+ * dir.c (glob_helper): must not closedir() when exception raised
+ while globbing "**".
+
+ * marshal.c (w_uclass): unused variable.
+
+ * re.c (match_clone): unused.
+
+ * regex.c (re_compile_pattern): get rid of implicit promotion from
+ plain char to int.
+
Wed Sep 25 17:46:46 2002 NAKAMURA Usaku <usa@ruby-lang.org>
* lib/mkmf.rb (libpathflag): restore ENV['LIB'] when some error occured.
@@ -11,7 +23,7 @@ Mon Sep 23 23:22:43 2002 Nobuyoshi Nakada <nobu.nokada@softhome.net>
* parse.y (yylex): nextc() returns -1 at end of input, not 0.
- * parse.y (newline_node): reduce deplicated newline node.
+ * parse.y (newline_node): reduce duplicated newline node.
* parse.y (literal_concat): get rid of warning.
diff --git a/dir.c b/dir.c
index 212f71329a..fa1f6fbc39 100644
--- a/dir.c
+++ b/dir.c
@@ -789,7 +789,7 @@ glob_helper(path, sub, flags, func, arg)
strcpy(t+3, m);
status = glob_helper(buf, t, flags, func, arg);
free(buf);
- if (status) goto finalize;
+ if (status) break;
continue;
}
free(buf);
@@ -801,7 +801,7 @@ glob_helper(path, sub, flags, func, arg)
if (!m) {
status = glob_call_func(func, buf, arg);
free(buf);
- if (status) goto finalize;
+ if (status) break;
continue;
}
tmp = ALLOC(struct d_link);
@@ -810,8 +810,8 @@ glob_helper(path, sub, flags, func, arg)
link = tmp;
}
}
- finalize:
closedir(dirp);
+ finalize:
free(base);
free(magic);
if (link) {
diff --git a/marshal.c b/marshal.c
index 0e54f42cc8..1f50848073 100644
--- a/marshal.c
+++ b/marshal.c
@@ -293,7 +293,6 @@ w_uclass(obj, base_klass, arg)
struct dump_arg *arg;
{
VALUE klass = CLASS_OF(obj);
- char *path;
w_extended(klass, arg);
if (klass != base_klass) {
diff --git a/re.c b/re.c
index 366387b6ac..0e4cd56c40 100644
--- a/re.c
+++ b/re.c
@@ -527,23 +527,6 @@ match_alloc(klass)
}
static VALUE
-match_clone(match)
- VALUE match;
-{
- NEWOBJ(clone, struct RMatch);
- CLONESETUP(clone, match);
-
- clone->str = RMATCH(match)->str;
- clone->regs = 0;
-
- clone->regs = ALLOC(struct re_registers);
- clone->regs->allocated = 0;
- re_copy_registers(clone->regs, RMATCH(match)->regs);
-
- return (VALUE)clone;
-}
-
-static VALUE
match_become(obj, orig)
VALUE obj, orig;
{
diff --git a/regex.c b/regex.c
index 9cb4b75c93..e9617a628f 100644
--- a/regex.c
+++ b/regex.c
@@ -1683,9 +1683,9 @@ re_compile_pattern(pattern, size, bufp)
while ((int)b[-1] > 0 && b[b[-1] - 1] == 0)
b[-1]--;
if (b[-1] != (1 << BYTEWIDTH) / BYTEWIDTH)
- memmove(&b[b[-1]], &b[(1 << BYTEWIDTH) / BYTEWIDTH],
+ memmove(&b[(unsigned char)b[-1]], &b[(1 << BYTEWIDTH) / BYTEWIDTH],
2 + EXTRACT_UNSIGNED(&b[(1 << BYTEWIDTH) / BYTEWIDTH])*8);
- b += b[-1] + 2 + EXTRACT_UNSIGNED(&b[b[-1]])*8;
+ b += b[-1] + 2 + EXTRACT_UNSIGNED(&b[(unsigned char)b[-1]])*8;
break;
case '(':
@@ -2194,9 +2194,9 @@ re_compile_pattern(pattern, size, bufp)
while ((int)b[-1] > 0 && b[b[-1] - 1] == 0)
b[-1]--;
if (b[-1] != (1 << BYTEWIDTH) / BYTEWIDTH)
- memmove(&b[b[-1]], &b[(1 << BYTEWIDTH) / BYTEWIDTH],
+ memmove(&b[(unsigned char)b[-1]], &b[(1 << BYTEWIDTH) / BYTEWIDTH],
2 + EXTRACT_UNSIGNED(&b[(1 << BYTEWIDTH) / BYTEWIDTH])*8);
- b += b[-1] + 2 + EXTRACT_UNSIGNED(&b[b[-1]])*8;
+ b += b[-1] + 2 + EXTRACT_UNSIGNED(&b[(unsigned char)b[-1]])*8;
break;
case 'w':