Skip to content

Commit

Permalink
19991125
Browse files Browse the repository at this point in the history
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@570 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
  • Loading branch information
matz committed Nov 25, 1999
1 parent 8e48dc1 commit ebab487
Show file tree
Hide file tree
Showing 14 changed files with 617 additions and 88 deletions.
33 changes: 33 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,32 @@
Mon Nov 22 14:07:24 1999 Koji Arai <[email protected]>

* ruby.c (proc_options): variable e_script should be visited by
garbage collector.

Sat Nov 20 10:10:41 1999 Yukihiro Matsumoto <[email protected]>

* hash.c (inspect_i): value may be nil, check revised.

Fri Nov 19 18:06:21 1999 Yukihiro Matsumoto <[email protected]>

* dir.c (glob): recurseve wildcard match by `**' ala zsh.

Fri Nov 19 11:44:26 1999 EGUCHI Osamu <[email protected]>

* variable.c: was returning void value.

Fri Nov 19 03:57:22 1999 Nobuyoshi Nakada <[email protected]>

* file.c: add methods Stat struct class to reduce stat(2).

Thu Nov 18 16:18:27 1999 Yukihiro Matsumoto <[email protected]>

* lib/pstore.rb: mutual lock by flock(2).

Thu Nov 18 11:44:13 1999 Masahiro Tomita <[email protected]>

* io.c (read_all): should check bytes too.

Wed Nov 17 02:40:40 1999 Yukihiro Matsumoto <[email protected]>

* io.c (Init_IO): $defout (alias of $>) added.
Expand Down Expand Up @@ -37,6 +66,10 @@ Sat Nov 13 07:34:18 1999 Yukihiro Matsumoto <[email protected]>
* parse.y (assignable): allow constant assignment in methods;
constants should be called `shared variable'.

Fri Nov 12 23:52:19 1999 Katsuyuki Komatsu <[email protected]>

* process.c (rb_f_system): argument check for NT, __EMX__, DJGPP.

Wed Nov 10 21:54:11 1999 EGUCHI Osamu <[email protected]>

* hash.c (rb_any_cmp): Fixed return without value.
Expand Down
2 changes: 0 additions & 2 deletions MANIFEST
Original file line number Diff line number Diff line change
Expand Up @@ -234,8 +234,6 @@ win32/config.h
win32/config.status
win32/ntsetup.bat
win32/ruby.def
win32/sdbm.c
win32/sdbm.h
win32/win32.c
win32/win32.h
x68/fconvert.c
Expand Down
5 changes: 3 additions & 2 deletions ToDo
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@ Language Spec.

- def foo; .. rescue .. end
- compile time string concatenation, "hello" "world" => "helloworld"
- rescue modifier; a rescue b => begin a rescue; b end
- assignable constant, which now should be called shared variable.
- class variable (prefix?) -- done by shared variable
- rescue modifier; a rescue b => begin a rescue; b end
* operator !! for rescue.
* objectify symbols
* objectify characters
* ../... outside condition invokes operator method too.
Expand Down Expand Up @@ -39,8 +40,8 @@ Standard Libraries
- Array#{first,last,at}
- Dir.glob(pat){|f|...}
- sprintf/printf's $ to specify argument order
- Dir.glob("**/*.c") ala zsh
* debugger for thread programming
* Dir.glob("**/*.c") ala zsh
* Struct::new([name,]member,...) ??
* String#scanf(?)
* Object#fmt(?)
Expand Down
32 changes: 24 additions & 8 deletions dir.c
Original file line number Diff line number Diff line change
Expand Up @@ -557,9 +557,10 @@ glob(path, func, arg)
if (*p == '/') p++;
m = strchr(p, '/');
if (has_magic(p, m)) {
char *dir, *base, *magic;
char *dir, *base, *magic, *buf;
DIR *dirp;
struct dirent *dp;
int recursive = 0;

struct d_link {
char *path;
Expand All @@ -570,24 +571,39 @@ glob(path, func, arg)
if (path == p) dir = ".";
else dir = base;

magic = extract_elem(p);
if (strcmp(magic, "**") == 0) {
recursive = 1;
buf = ALLOC_N(char, strlen(base)+strlen(m)+3);
sprintf(buf, "%s%s%s", base, (*base)?"":".", m);
glob(buf, func, arg);
free(buf);
}
dirp = opendir(dir);
if (dirp == NULL) {
free(base);
break;
}
magic = extract_elem(p);
for (dp = readdir(dirp); dp != NULL; dp = readdir(dirp)) {
if (recursive) {
if (strcmp(".", dp->d_name) == 0 || strcmp("..", dp->d_name) == 0)
continue;
buf = ALLOC_N(char, strlen(base)+NAMLEN(dp)+strlen(m)+6);
sprintf(buf, "%s%s%s/**%s", base, (*base)?"/":"", dp->d_name, m);
glob(buf, func, arg);
free(buf);
continue;
}
if (fnmatch(magic, dp->d_name, FNM_PERIOD|FNM_PATHNAME) == 0) {
char *fix = ALLOC_N(char, strlen(base)+NAMLEN(dp)+2);

sprintf(fix, "%s%s%s", base, (*base)?"/":"", dp->d_name);
buf = ALLOC_N(char, strlen(base)+NAMLEN(dp)+2);
sprintf(buf, "%s%s%s", base, (*base)?"/":"", dp->d_name);
if (!m) {
(*func)(fix, arg);
free(fix);
(*func)(buf, arg);
free(buf);
continue;
}
tmp = ALLOC(struct d_link);
tmp->path = fix;
tmp->path = buf;
tmp->next = link;
link = tmp;
}
Expand Down
2 changes: 1 addition & 1 deletion enum.c
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ enum_grep(obj, pat)

arg[0] = pat; arg[1] = tmp = rb_ary_new();
if (rb_iterator_p()) {
rb_iterate(rb_each, obj, grep_iter_i, pat);
rb_iterate(rb_each, obj, grep_iter_i, (VALUE)arg);
}
else {
rb_iterate(rb_each, obj, grep_i, (VALUE)arg);
Expand Down
Loading

0 comments on commit ebab487

Please sign in to comment.