aboutsummaryrefslogtreecommitdiffstats
path: root/lib/stdlib/src/c.erl
diff options
context:
space:
mode:
authorErlang/OTP <[email protected]>2009-12-14 12:51:16 +0000
committerErlang/OTP <[email protected]>2009-12-14 12:51:16 +0000
commit76623933ce8b95f3be52c06311374370e94f1348 (patch)
treeb16f8c69f1e370a786d26bbd6507eb7fb445cd34 /lib/stdlib/src/c.erl
parent420b28bb007946307eeda5d4e2bf200fe0ee25ba (diff)
parentb9993d7da4ba33387a8b0217c4e7bebd7589c291 (diff)
downloadotp-76623933ce8b95f3be52c06311374370e94f1348.tar.gz
otp-76623933ce8b95f3be52c06311374370e94f1348.tar.bz2
otp-76623933ce8b95f3be52c06311374370e94f1348.zip
Merge branch 'as/c_nc-fix' into ccase/r13b04_dev
* as/c_nc-fix: c_SUITE: Use new style guard tests Fix c:nc to use outdir or cwd to find compiled object file OTP-8337 c:nc/{1,2} used to assume that the beam file was created in the same directory as the source code and failed to load the code if it was not. Corrected to look for the beam file in the current directory or in the directory specified by the {outdir,Dir} option. (Thanks to Alex Suraci.)
Diffstat (limited to 'lib/stdlib/src/c.erl')
-rw-r--r--lib/stdlib/src/c.erl4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/stdlib/src/c.erl b/lib/stdlib/src/c.erl
index 9e4cec5db2..433833e233 100644
--- a/lib/stdlib/src/c.erl
+++ b/lib/stdlib/src/c.erl
@@ -197,7 +197,9 @@ nc(File, Opts0) when is_list(Opts0) ->
Opts = Opts0 ++ [report_errors, report_warnings],
case compile:file(File, Opts) of
{ok,Mod} ->
- Fname = concat([File, code:objfile_extension()]),
+ Dir = outdir(Opts),
+ Obj = filename:basename(File, ".erl") ++ code:objfile_extension(),
+ Fname = filename:join(Dir, Obj),
case file:read_file(Fname) of
{ok,Bin} ->
rpc:eval_everywhere(code,load_binary,[Mod,Fname,Bin]),