* 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
This commit is contained in:
nobu 2002-09-25 14:52:37 +00:00
Родитель 44b2f1609c
Коммит 12852c2e9a
5 изменённых файлов: 20 добавлений и 26 удалений

Просмотреть файл

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

6
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) {

Просмотреть файл

@ -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) {

17
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;

Просмотреть файл

@ -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':