diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2002-09-25 14:52:37 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2002-09-25 14:52:37 +0000 |
commit | 12852c2e9ad0b25395d32c4ee147eb770408cf41 (patch) | |
tree | adfa0f16338897148efd66dbfda189e44b9696b2 | |
parent | 44b2f1609ca6a4732066c70f06499e46ab5b6bf9 (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-- | ChangeLog | 14 | ||||
-rw-r--r-- | dir.c | 6 | ||||
-rw-r--r-- | marshal.c | 1 | ||||
-rw-r--r-- | re.c | 17 | ||||
-rw-r--r-- | regex.c | 8 |
5 files changed, 20 insertions, 26 deletions
@@ -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. @@ -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) { @@ -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) { @@ -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; { @@ -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': |