summaryrefslogtreecommitdiff
path: root/win32/file.c
AgeCommit message (Collapse)Author
2018-04-03removed never used variablenobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63066 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-03-28win32/file.c: relative path with drive letternobu
* win32/file.c (IS_ABSOLUTE_PATH_P): home directory should not be a relative path regardless a drive letter. PathIsRelativeW returns FALSE on such path. [ruby-core:86356] [Bug #14638] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62952 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-12-07const pointer is not able to be free.usa
* win32/file.c (rb_default_home_dir): should not be marked as const. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57007 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-11-26file.c: home directory from systemnobu
* file.c (rb_default_home_dir): resolve home directory from the system database when HOME is not set. [Feature #12695] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56902 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-11-26win32.c: special folders as home dirnobu
* win32/win32.c (rb_w32_home_dir): move from win32/file.c to try special folders. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56901 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-08-25win32/file.c: use ALLOC_Nnobu
* win32/file.c (home_dir, replace_to_long_name): use ALLOC_N instead of casted xmalloc with multiplication. win32/file.c (rb_file_expand_path_internal): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56008 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-08-25win32/file.h: rb_w32_filecpnobu
* win32/file.h (rb_w32_filecp): add declaration. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56007 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-08-24win32/file.c: remove a codepage argumentnobu
* win32/file.c (append_wstr): remove a codepage argument, and use INVALID_CODE_PAGE for conversion by econv. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56006 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-08-24win32/file.c: fix result lengthnobu
* win32/file.c (append_wstr): exclude the terminator from the result length when input len == -1. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56004 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-08-24win32/file.c: use enumnobu
* win32/file.c (home_dir): use enum instead of magic numbers. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56000 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-04-28win32/file.c: fix reallocation thresholdnobu
* win32/file.c (replace_to_long_name): fix reallocation threshold. dereferenced size of a pointer is not same as the buffer size. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54807 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-04-28win32/file.c: remove unnecessary codenobu
* win32/file.c (replace_to_long_name): remove unnecessary backward scan for the last directory separator. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54806 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-04-22* file.c, win32/file.c: Removed obsoleted safe level checks.hsbt
[fix GH-1327] Patch by @cremno git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54668 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-04-10win32/file.c: fix freenobu
* win32/file.c (rb_file_expand_path_internal): should free wpath, but not xfree, corresponding to rb_w32_mbstr_to_wstr which allocates by malloc. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54526 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-01-29win32/file.c: drop garbagenobu
* win32/file.c (rb_readlink): drop garbage after the substitute name, as rb_w32_read_reparse_point returns the expected buffer size but "\??\" prefix is dropped from the result. * win32/win32.c (w32_readlink): ditto, including NUL-terminator. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53689 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-01-29* win32/win32.c (fileattr_to_unixmode, rb_w32_reparse_symlink_p): volumeusa
mount point should be treated as directory, not symlink. [ruby-core:72483] [Bug #11874] * win32/win32.c (rb_w32_read_reparse_point): check the reparse point is a volume mount point or not. * win32/file.c (rb_readlink): follow above change (but this pass won't be used). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53688 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-10-16file.c: non-blocking opennobu
* file.c (rb_file_load_ok): open in non-blocking mode withoout releasing GVL. don't care about others than regular files and directories. [ruby-dev:49272] [Bug #11559] * ruby.c (load_file_internal): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52139 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-09-02file.c: use filesystem encodingnobu
* file.c (rb_realpath_internal): use filesystem encoding if the argument is in ASCII encodings. * win32/file.c (rb_readlink): needs the result encoding. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51738 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-09-02win32: use ALLOCVnobu
* win32/file.c (rb_readlink): use ALLOCV to get rid potential memory leak by NoMemoryError in ALLOCV. * win32/win32.c (w32_readlink): allocate WCHAR path name and reparse buffer together. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51737 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-08-25win32.c: rb_w32_reparsenobu
* win32/win32.c (rb_w32_reparse): read reparse point in a dynamic buffer. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51676 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-08-02win32/file.c: use allocv buffer and APInobu
* win32/file.c (rb_freopen): convert path name into allocv buffer and get rid of conversion failure in the case non-terminated string. [ruby-core:69780] [Bug #11320] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51469 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-07-03file.c: _wfreopen_s on mingwnobu
* win32/file.c: some mingw compilers need a tweek for the declarations of _wfreopen_s. [Bug #11320] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51117 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-06-30file.c: not xfreenobu
* win32/file.c (rb_freopen): should free rb_w32_mbstr_to_wstr result instead of xfree. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51072 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-06-30* win32/file.c (rb_freopen): remove debug code.usa
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51071 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-06-30* win32/file.c (rb_freopen): need to terminate by NUL.usa
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51070 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-06-30io.c: reopen OS encoding pathnobu
* io.c (rb_io_reopen): freopen(3) with OS encoding path. [ruby-core:69780] [Bug #11320] * win32/file.c (rb_freopen): wrapper of wchar version freopen(3). use _wfreopen_s() if available. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51069 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-06-18* include/ruby/ruby.h: $SAFE=2 is now obsolete.hsbt
* dir.c, ext/fiddle/handle.c, ext/socket/basicsocket.c, file.c gc.c, io.c, process.c, safe.c, signal.c, win32/file.c: removed code for $SAFE=2 * test/erb/test_erb.rb, test/fiddle/test_handle.rb test/ruby/test_env.rb: removed tests for $SAFE=2. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50958 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-06-14file.c: open without gvlnobu
* file.c (rb_file_load_ok): try opening file without gvl not to lock entire process. [Bug #11060] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50887 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-03-30file.c: include terminatornobu
* win32/file.c (rb_readlink): include the terminator, since rb_w32_mbstr_to_wstr appends a terminator only when the length is not given explicitly. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50119 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-03-23file.c: move rb_readlink on Windowsnobu
* win32/file.c (rb_readlink): move from file.c for better buffer allocation and the result encoding. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50063 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-03-22file.c: check arguments lengthsnobu
* win32/file.c (rb_file_expand_path_internal): check arguments lengths and should not loose preci quielty. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50054 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-02-18win32/file.c: fix drive letternobu
* win32/file.c (rb_file_expand_path_internal): neither the drive of base directory nor the current drive are involved in the result if different than the drive of path. [ruby-core:68130] [Bug #10858] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49640 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-02-17win32/file.c: fix drive letternobu
* win32/file.c (rb_file_expand_path_internal): do not make invalid (or ADS) path if the path has a drive letter, the result also should have be under it. [ruby-core:68130] [Bug #10858] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49618 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-12-26never-NULL pointer checknobu
* dir.c (ruby_glob0): no need to check never-NULL pointer. reported by Denis Denisov <denji0k AT gmail.com>. * win32/file.c (rb_file_expand_path_internal): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49024 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-12-26win32: realloc failuresnobu
* win32/file.c (code_page_i): handle realloc failure. reported by Denis Denisov <denji0k AT gmail.com>. * win32/stub.c (stub_sysinit): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49023 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-12-24win32: suppress warningsnobu
* win32/file.c (home_dir, code_page_i): parenthesize to suppress warnings. * win32/win32.c (is_command_com, join_argv, w32_cmdvector, kill), (constat_attr_color_reverse, constat_attr): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48971 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-09-29win32/file.c: fix no user exceptionnobu
* win32/file.c (append_wstr): set expanded length, not length of appended string. fix "probable buffer overflow" bug. [ruby-core:65317] [Bug #10304] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47738 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-08-09win32/file.c: direct conversionnobu
* win32/file.c (user_length_in_path): count user name length in path. * win32/file.c (append_wstr): append WCHAR string to Ruby string directly without an intermediate buffer, if possible. * win32/file.c (rb_file_expand_path_internal): use above functions. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47118 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-08-09win32/file.c: share functions with win32.cnobu
* win32/file.c (rb_file_expand_path_internal, rb_file_load_ok): use functions defined in win32/win32.c. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47117 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-10-19win32/file.c: code page tablenobu
* win32/file.c (code_page): use simple array instead of st_table. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43363 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-10-19encoding.c: defer code page tablenobu
* encoding.c (rb_locale_encindex): defer initialization of win32 code page table until encoding db loaded. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43362 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-10-17file.c: fix memory leaknobu
* win32/file.c (rb_file_expand_path_internal): fix memory leaks at a non-absolute home exception. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43328 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-10-07win32/file.c: make mapping at initializationnobu
* win32/file.c (code_page_i, rb_w32_init_file): make encoding to code page mapping at initialization directly. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43169 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-10-07win32/file.c: use encoding indexnobu
* win32/file.c (code_page): use encoding index, which is primary entity, instead of encoding name. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43168 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-10-07win32/file.c: using st_tablenobu
* win32/file.c (code_page): cache using st_table, not RHash. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43166 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-10-07win32/file.c: check ASCII encodings firstnobu
* win32/file.c (code_page): check US-ASCII and ASCII-8bit before ordinary mapping. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43165 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-07-26win32/file.c: suppress warningnobu
* win32/file.c (convert_mb_to_wchar): omit never-true NULL check to suppress maybe-uninitialized warning in rb_file_load_ok(). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42191 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-07-26win32/file.c: fix target encodingnobu
* win32/file.c (fix_string_encoding): fix target encoding. the parameter `encoding' is not the target encoding but the original encoding. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42190 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-07-26win32/file.c: adjust indentnobu
* win32/file.c (get_user_from_path): adjust indent. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42189 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-07-26load.c: search in OS path encodingnobu
* load.c (rb_load_internal): use rb_load_file_str() to keep path encoding. * load.c (rb_require_safe): search in OS path encoding for Windows. * ruby.c (rb_load_file_str): load file with keeping path encoding. * win32/file.c (rb_file_load_ok): use WCHAR type API assuming incoming path is encoded in UTF-8. [ruby-core:56136] [Bug #8676] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42183 b2dd03c8-39d4-4d8f-98ff-823fe69b080e