From 12852c2e9ad0b25395d32c4ee147eb770408cf41 Mon Sep 17 00:00:00 2001 From: nobu Date: Wed, 25 Sep 2002 14:52:37 +0000 Subject: * 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 --- ChangeLog | 14 +++++++++++++- dir.c | 6 +++--- marshal.c | 1 - re.c | 17 ----------------- regex.c | 8 ++++---- 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 + + * 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 * lib/mkmf.rb (libpathflag): restore ENV['LIB'] when some error occured. @@ -11,7 +23,7 @@ Mon Sep 23 23:22:43 2002 Nobuyoshi Nakada * 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 @@ -526,23 +526,6 @@ match_alloc(klass) return (VALUE)match; } -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': -- cgit v1.2.3