summaryrefslogtreecommitdiff
path: root/dir.c
AgeCommit message (Collapse)Author
2004-08-19* dir.c (free_dir): fix memory leak. reported by yamamotomatz
madoka. * eval.c (bind_eval): new method. [RCR 251] * string.c (rb_str_clear): new method. [ruby-dev:24104] * io.c (rb_io_reopen): should clear allocated OpenFile. pointed out by Guy Decoux. [ruby-core:03288] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@6794 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-08-09Roll in Austin Ziegler's patchdave
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@6750 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-07-17* dir.c (bracket): use NULL instead of 0.knu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@6667 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-06-12* dir.c: RDOC for File::FNM_CASEFOLD was missed.ocean
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@6453 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-05-06* dir.c (rb_push_glob): simplified code (not change behavior)ocean
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@6251 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-04-19* dir.c: Updated RDocs.ocean
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@6182 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-04-19* dir.c: Updated RDocs.ocean
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@6180 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-04-15* dir.c (rb_push_glob): Dir.glob() should return nil if block is given.ocean
(http://www.ruby-lang.org/ja/man/index.cgi?cmd=view;name=Dir) * dir.c (push_braces): Dir.glob() should handle '{ }' nested more than 3 times. * dir.c (push_braces, rb_push_glob): Dir.glob() should handle escaped '{' and '}' and ','. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@6163 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-04-12* dir.c (rb_glob2, rb_glob, push_globs, push_braces, rb_push_glob):ocean
fix memory leak to occur when block is interrupted in Dir.glob. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@6141 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-04-09* dir.c (has_magic, find_dirsep): incomplete '[' matches no characterocean
in Dir.glob. (follows File.fnmatch's behavior) * dir.c (fnmatch_helper): incomplete escape is ignored in File.fnmatch. (follows Dir.glob's behavior) * dir.c (find_dirsep): '/' between '[' and ']' is ignored in Dir.glob. (follows File.fnmatch with File::FNM_PATHNAME 's behavior) * dir.c (find_dirsep): escaped slash '\/' loses its meaning as directory separator in Dir.glob. [ruby-dev:23291] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@6129 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-04-07* pack.c (pack_pack): use NUM2INT() instead of num2i32().matz
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@6120 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-04-07* file.c (rb_get_path): get path string via "to_path" method ifmatz
path object is not a string. [Ruby2] * gc.c (rb_gc_call_finalizer_at_exit): do not free threads in the exit finalizers. * io.c (rb_io_reopen): should use rb_io_check_io(). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@6114 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-03-16* dir.c (fnmatch_helper): File.fnmatch('\.', '.') should return true.ocean
(Rev1.112 lost compatiblity) * dir.c (fnmatch_helper): File.fnmatch('\/', '/', File::FNM_PATHNAME) should return true. (Rev1.112 lost compatiblity) * dir.c (fnmatch): '**/' shouldn't match leading period unless File::FNM_DOTMATCH is set. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@5955 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-03-12* dir.c (fnmatch):ocean
directory recursion '**/' can be used with File::FNM_PATHNAME. [ruby-dev:22901] * dir.c (fnmatch_helper): only '/' is accepted as path separator even in DOSISH environment. [ruby-dev:22974] [ruby-list:39337] * dir.c (fnmatch_helper): faster '*' matching. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@5944 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-03-08* dir.c (range): Cancel change for incomplete '['. More discussionocean
is needed. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@5926 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-03-08* dir.c (range): treat incomplete '[' as ordinary character (likeocean
has_magic does). fix buffer overrun at incomplete escape like '[\'. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@5921 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-02-24* dir.c (glob_helper): '**/' should not match leading periodocean
unless File::FNM_DOTMATCH is set. (like '*/') git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@5824 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-02-24* dir.c (fnmatch): File.fnmatch with FNM_PATHNAME was brokenocean
for the pattern including '*' followed by '/'. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@5822 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-02-16* dir.c (CompareImpl): File.fnmatch and Dir.glob get better performanceocean
in Win32. This is achived by calling downcase() for single-byte characters. CharLower() is only called for multi-byte characters. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@5719 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-02-15* dir.c (push_braces): remove wrong const.ocean
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@5715 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-02-15* ruby.h, dir.c (rb_glob): add const.ocean
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@5709 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-02-08* dir.c (glob_helper): Dir.glob('**/') did not work.ocean
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@5644 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-02-07Did some styles (no change to behavior)ocean
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@5641 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-02-07* dir.c (fnmatch):ocean
File.fnmatch('\[1\]' , '[1]') should return true. [ruby-dev:22815] File.fnmatch('*?', 'a') should return true. [ruby-dev:22819] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@5639 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-01-29* dir.c (glob_helper): infinite loop bug in win32 code.matz
[ruby-dev:22770] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@5579 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-01-29* dir.c: merge tuning from H.Yamamoto <ocean@m2.ccsnet.ne.jp>.matz
[ruby-dev:22761] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@5577 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-01-21* defines.h: define RUBY_MBCHAR_MAX instead of MB_CUR_MAX.siena
* dir.c (Next, emx_mblen): use RUBY_MBCHAR_MAX for mblen(). * file.c (CharNext): ditto. * ruby.c (translate_char): ditto. * util.c (__crt0_glob_function): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@5530 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-01-10* dir.c (dir_inspect): new method, Dir#inspect. [ruby-dev:22562]nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@5425 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-01-08* dir.c (glob_helper): should not recurse in exceptional status.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@5416 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-01-07* dir.c (glob_helper): fix memory leak.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@5405 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-01-05* dir.c: merge tuning from H.Yamamoto <ocean@m2.ccsnet.ne.jp>.matz
[ruby-dev:22486] * pack.c (pack_unpack): unpack requires big endian offet (OFF16B and OFF32B). The patch is from Minero Aoki in [ruby-dev:22489] * pack.c (OFF16B): add big-endian offset again. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@5374 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-01-02* dir.c: merge tuning from H.Yamamoto <ocean@m2.ccsnet.ne.jp>.matz
[ruby-dev:22476] * io.c (argf_eof): ARGF.eof? should not have any side effect. [ruby-dev:22469] * io.c (argf_each_byte): should return self. [ruby-dev:22465] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@5365 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-12-19Document Class and Dirdave
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@5222 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-12-18* dir.c (fnmatch): unlike find_dirsep(), rb_path_next() nevernobu
return NULL. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@5211 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-12-15commit missnobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@5192 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-12-15* dir.c (check_dirname): check string safety and remove extraneousnobu
trailing directory separators. [ruby-dev:22279] * file.c: extern rb_path_next, rb_path_skip_prefix, rb_path_last_separator, rb_path_end. * intern.h: prototypes for rb_path_next, rb_path_skip_prefix, rb_path_last_separator, rb_path_end. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@5191 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-11-22* gc.c (Init_stack): stack region is far smaller than usual ifmatz
pthread is used. * marshal.c (w_extended): singleton methods should not be checked when dumping via marshal_dump() or _dump(). [ruby-talk:85909] * file.c (getcwdofdrv): avoid using getcwd() directly, use my_getcwd() instead. * merged NeXT, OpenStep, Rhapsody ports patch from Eric Sunshine <sunshine@sunshineco.com>. [ruby-core:01596] * marshal.c (w_object): LINK check earlier than anything else, i.e. do not dump TYPE_IVAR for already dumped objects. (ruby-bugs PR#1220) * eval.c (rb_eval): call "inherited" only when a new class is generated; not on reopening. * eval.c (eval): prepend error position in evaluating string to * configure.in: revived NextStep, OpenStep, and Rhapsody ports which had become unbuildable; enhanced --enable-fat-binary option so that it accepts a list of desired architectures (rather than assuming a fixed list), or defaults to a platform-appropriate list if user does not provide an explicit list; made the default list of architectures for MAB (fat binary) more comprehensive; now uses -fno-common even when building the interpreter (in addition to using it for extensions), thus allowing the interpreter to be embedded into a plugin module of an external project (in addition to allowing embedding directly into an application); added checks for <netinet/in_systm.h> (needed by `socket' extension) and getcwd(); now ensures that -I/usr/local/include is employed when extensions' extconf.rb scripts invoke have_header() since extension checks on NextStep and OpenStep will fail without it if the desired resource resides in the /usr/local tree; fixed formatting of --help message. * Makefile.in: $(LIBRUBY_A) rule now deletes the archive before invoking $(AR) since `ar' on Apple/NeXT can not "update" MAB archives (see configure's --enable-fat-binary option); added rule for new missing/getcwd.c. * defines.h: fixed endian handling during MAB build (see configure's --enable-fat-binary option) to ensure that all portions of the project see the correct WORDS_BIGENDIAN value (some extension modules were getting the wrong endian setting); added missing constants GETPGRP_VOID, WNOHANG, WUNTRACED, X_OK, and type pid_t for NextStep and OpenStep; removed unnecessary and problematic HAVE_SYS_WAIT_H define in NeXT section. * dir.c: do not allow NAMLEN() macro to trust dirent::d_namlen on NextStep since, on some installations, this value always resolves uselessly to zero. * dln.c: added error reporting to NextStep extension loader since the previous behavior of failing silently was not useful; now ensures that NSLINKMODULE_OPTION_BINDNOW compatibility constant is defined for OpenStep and Rhapsody; no longer includes <mach-o/dyld.h> twice on Rhapsody since this header lacks multiple-include protection, which resulted in "redefinition" compilation errors. * main.c: also create hard reference to objc_msgSend() on NeXT platforms (in addition to Apple platforms). * lib/mkmf.rb: now exports XCFLAGS from configure script to extension makefiles so that extensions can be built MAB (see configure's --enable-fat-binary option); also utilize XCFLAGS in cc_command() (but not cpp_command() because MAB flags are incompatible with direct invocation of `cpp'). * ext/curses/extconf.rb: now additionally checks for presence of these curses functions which are not present on NextStep or Openstep: bkgd(), bkgdset(), color(), curs(), getbkgd(), init(), scrl(), set(), setscrreg(), wattroff(), wattron(), wattrset(), wbkgd(), wbkgdset(), wscrl(), wsetscrreg() * ext/curses/curses.c: added appropriate #ifdef's for additional set of curses functions now checked by extconf.rb; fixed curses_bkgd() and window_bkgd() to correctly return boolean result rather than numeric result; fixed window_getbkgd() to correctly signal an error by returning nil rather than -1. * ext/etc/etc.c: setup_passwd() and setup_group() now check for null pointers before invoking rb_tainted_str_new2() upon fields extracted from `struct passwd' and `struct group' since null pointers in some fields are common on NextStep/OpenStep (especially so for the `pw_comment' field) and rb_tainted_str_new2() throws an exception when it receives a null pointer. * ext/pty/pty.c: include "util.h" for strdup()/ruby_strdup() for platforms such as NextStep and OpenStep which lack strdup(). * ext/socket/getaddrinfo.c: cast first argument of getservbyname(), gethostbyaddr(), and gethostbyname() from (const char*) to non-const (char*) for older platforms such as NextStep and OpenStep. * ext/socket/socket.c: include "util.h" for strdup()/ruby_strdup() for platforms such as NextStep and OpenStep which lack strdup(); include <netinet/in_systm.h> if present for NextStep and OpenStep; cast first argument of gethostbyaddr() and getservbyname() from (const char*) to non-const (char*) for older platforms. * ext/syslog/syslog.c: include "util.h" for strdup()/ruby_strdup() for platforms such as NextStep and OpenStep which lack strdup(). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@5002 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-08-18* dir.c (glob_helper): preserve raw order for **.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4403 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-06-23* dir.c (find_dirsep): get rid of warnings.nobu
* eval.c (error_print): temporary value might be disposed by GC. * hash.c (env_has_value, env_index): should not increment NULL. * io.c (io_read, rb_io_sysread): not read when length is 0. * io.c (rb_io_reopen): ensure initialized IO. * io.c (rb_io_init_copy): sychronize file pointer. * io.c (rb_io_s_pipe): make exception proof. * string.c (rb_str_rindex_m): Fixnum 0 matched end of string. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3984 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-05-19* dir.c (push_braces): do not push_braces() unless rbrace is found.matz
(ruby-bugs-ja:PR#469) git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3824 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-03-25* io.c (rb_io_initialize): should check rb_secure(4).matz
* dir.c (dir_s_getwd): should check rb_secure(4). * object.c (rb_obj_infect): function version of OBJ_INFECT(). * eval.c (rb_secure_update): new function to check object update. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3611 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-03-04* io.c (rb_io_popen): do not call rb_io_close() directly, callmatz
"close" method instead. [ruby-dev:19717] * io.c (rb_io_s_open): ditto. * hash.c (rb_any_hash): remove DEFER_INTS. all do_hash() calls in st.c are at the top of functions. No reentrant problem. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3551 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-01-16Updated Copyrights of Matz to 2003.michal
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3345 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-12-21* array.c (ary_alloc), dir.c (dir_s_alloc), eval.c (thgroup_s_alloc),usa
file.c (rb_stat_s_alloc), hash.c (hash_alloc), io.c (io_alloc), object.c (rb_module_s_alloc, rb_class_allocate_instance), re.c (match_alloc, rb_reg_s_alloc), string.c (str_alloc), time.c (time_s_alloc), ext/digest/digest.c (rb_digest_base_alloc), ext/tcltklib/tcltklib.c (ip_alloc), ext/win32ole/win32ole.c (fole_s_allocate, fev_s_allocate) : add prototype to get rid of VC++ warnings. * ext/sdbm/init.c (fsdbm_alloc): allocator takes only one argument. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3197 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-12-20* parse.y (do_block): split "do" block and tLBRACE_ARG block.matz
* parse.y (cmd_brace_block): new tLBRACE_ARG block rule * parse.y (command): can take optional cmd_brace_block; use %prec to resolve shift/reduce conflict. (ruby-bugs-ja PR#372) * eval.c (ruby_finalize): trace_func should be cleared here (after executing exit procs and finalizers). * eval.c (rb_define_alloc_func): new allocation framework, based on Nobu's work [ruby-dev:19116]. "allocate" method is no longer used for object allocation. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3188 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-12-15* configure.in, defines.h, dir.c, dir.h, dln.c, error.c,uema2
eval.c, file.c, hash.c, io.c, main.c, missing.c, process.c, ruby.c, rubysig.h, signal.c, st.c, util.c, util.h, bcc/Makefile.sub, win32/Makefile.sub, win32/win32.h, ext/Win32API/Win32API.c, ext/socket/getaddrinfo.c, ext/socket/getnameinfo.c, ext/socket/socket.c, ext/tcltklib/stubs.c : replace "NT" with "_WIN32", add DOSISH_DRIVE_LETTER * wince/exe.mak : delete \r at the end of lines. * wince/mswince-ruby17.def : delete rb_obj_become git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3148 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-12-02WinCE patch mergedmatz
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3106 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-11-22* file.c (rb_find_file_ext): should not terminate searching withmatz
empty path, just ignore. * dir.c: remove <sys/parm.h> inclusion. * compar.c (cmp_eq,cmp_gt,cmp_ge,cmp_lt,cmp_le): check using rb_cmpint(). * error.c (init_syserr): remove sys_nerr dependency. * numeric.c (num_cmp): added to satisfy Comparable assumption. * eval.c (rb_add_method): "initialize" should be public if it is a singleton method. * regex.c (re_match): avoid dereferencing if size == 0. (ruby-bugs-ja:PR#360) * time.c (time_cmp): should return nil if an operand is not a number nor time. (ruby-bugs-ja:PR#359) * file.c (rb_stat_cmp): should return nil if an operand is not File::Stat. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3076 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-09-25* dir.c (glob_helper): must not closedir() when exception raisednobu
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
2002-09-13* dir.c (glob_func_caller): add prototype to get rid of warning.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2864 b2dd03c8-39d4-4d8f-98ff-823fe69b080e