Bug #3077
closed`expand_path': couldn't find HOME environment on Windows
Description
=begin
1.9.2dev didn't set HOME environment on Windows.
C:\Ruby19\bin>ruby -ve 'p ENV["HOME"]'
ruby 1.9.1p129 (2009-05-12 revision 23412) [i386-mingw32]
"C:/Documents and Settings/Compaq_Owner"
C:\work\snapshot>ruby -ve 'p ENV["HOME"]'
ruby 1.9.2dev (2010-04-02 trunk 27160) [i386-mswin32_90]
nil
C:\work\snapshot>ruby -ve 'p File.expand_path("~")'
ruby 1.9.2dev (2010-04-02 trunk 27160) [i386-mswin32_90]
-e:1:in expand_path': couldn't find HOME environment -- expanding
~' (Argument
Error)
from -e:1:in `'
As a result, The nightly snapshot unable to build RDoc.
Generating RDoc documentation
.\ruby.exe -I./lib -I".ext/i386-mswin32_90" "./tool/runruby.rb" --extout
=".ext" -- "./bin/rdoc" --all --ri --op ".ext/rdoc" "."
C:/work/snapshot/lib/rdoc/ri/paths.rb:16:in expand_path': couldn't find HOME en vironment -- expanding
~' (ArgumentError)
from C:/work/snapshot/lib/rdoc/ri/paths.rb:16:in <module:Paths>' from C:/work/snapshot/lib/rdoc/ri/paths.rb:6:in
<top (required)>'
from C:/work/snapshot/lib/rdoc/options.rb:3:in require' from C:/work/snapshot/lib/rdoc/options.rb:3:in
<top (required)>'
from C:/work/snapshot/lib/rdoc/rdoc.rb:12:in require' from C:/work/snapshot/lib/rdoc/rdoc.rb:12:in
<top (required)>'
from ./bin/rdoc:11:in require' from ./bin/rdoc:11:in
'
NMAKE : fatal error U1077: '.\ruby.exe' : '0x1' 반환 코드입니다.
Stop.
=end
Updated by phasis68 (Heesob Park) over 14 years ago
=begin
Here is a patch
--- win32.c 2010-04-02 11:21:28.658460040 +0900
+++ win32.c.new 2010-04-02 11:21:53.730708450 +0900
@@ -456,7 +456,7 @@
#define env wk.val
#define set_env_val(vname) do {
typedef char namesizecheck[numberof(wk.name) < numberof(vname) - 1 ? -1 : 1]; \
-
WCHAR *const buf = wk.name + numberof(wk.name) - numberof(vname); \
-
} while (0)WCHAR *const buf = wk.name + numberof(wk.name) - numberof(vname) + 1; \ MEMCPY(buf, vname, WCHAR, numberof(vname) - 1); \ _wputenv(buf); \
=end
Updated by usa (Usaku NAKAMURA) over 14 years ago
- Status changed from Open to Closed
- % Done changed from 0 to 100
=begin
This issue was solved with changeset r27171.
Heesob, thank you for reporting this issue.
Your contribution to Ruby is greatly appreciated.
May Ruby be with you.
=end