From 25196f4b994df5364eb060bff8418a0154622ed4 Mon Sep 17 00:00:00 2001
From: bitnitdit <bitnitdit@gmail.com>
Date: Mon, 11 Sep 2017 20:57:17 +0800
Subject: Prevent .erlang from prepending string to the erl root dir

Any output string from .erlang to stdout will be prepend to
code:root_dir(), so it will cause the retrieved dir incorrect.

The fix is to start erl with the no_dot_erlang boot file.
---
 priv/templates/extended_bin_windows | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

(limited to 'priv/templates/extended_bin_windows')

diff --git a/priv/templates/extended_bin_windows b/priv/templates/extended_bin_windows
index 139edaa..85c57f4 100644
--- a/priv/templates/extended_bin_windows
+++ b/priv/templates/extended_bin_windows
@@ -98,7 +98,7 @@
 @for /f "delims=" %%i in ('where erl') do @(
   set erl=%%i
 )
-@set dir_cmd="%erl%" -noshell -eval "io:format(\"~s\", [filename:nativename(code:root_dir())])." -s init stop
+@set dir_cmd="%erl%" -boot no_dot_erlang -noshell -eval "io:format(\"~s\", [filename:nativename(code:root_dir())])." -s init stop
 @for /f "delims=" %%i in ('%%dir_cmd%%') do @(
   set erl_root=%%i
 )
-- 
cgit v1.2.3