Skip to content

Commit

Permalink
* dir.c (glob_helper): must not closedir() when exception raised
Browse files Browse the repository at this point in the history
  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
  • Loading branch information
nobu committed Sep 25, 2002
1 parent 44b2f16 commit 12852c2
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 26 deletions.
14 changes: 13 additions & 1 deletion ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,15 @@
Wed Sep 25 23:51:29 2002 Nobuyoshi Nakada <[email protected]>

* 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 <[email protected]>

* lib/mkmf.rb (libpathflag): restore ENV['LIB'] when some error occured.
Expand All @@ -11,7 +23,7 @@ Mon Sep 23 23:22:43 2002 Nobuyoshi Nakada <[email protected]>

* 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.

Expand Down
6 changes: 3 additions & 3 deletions dir.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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);
Expand All @@ -810,8 +810,8 @@ glob_helper(path, sub, flags, func, arg)
link = tmp;
}
}
finalize:
closedir(dirp);
finalize:
free(base);
free(magic);
if (link) {
Expand Down
1 change: 0 additions & 1 deletion marshal.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
17 changes: 0 additions & 17 deletions re.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
8 changes: 4 additions & 4 deletions regex.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 '(':
Expand Down Expand Up @@ -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':
Expand Down

0 comments on commit 12852c2

Please sign in to comment.