From 23c0bb600c792775896dbe87bb28949585336aeb Mon Sep 17 00:00:00 2001 From: yuyi Date: Wed, 27 May 2020 09:32:39 +0800 Subject: [PATCH] scanner: fix vmod_file on windows --- vlib/v/scanner/scanner.v | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/vlib/v/scanner/scanner.v b/vlib/v/scanner/scanner.v index a75a976dd5..ab21ff2744 100644 --- a/vlib/v/scanner/scanner.v +++ b/vlib/v/scanner/scanner.v @@ -783,7 +783,11 @@ pub fn (mut s Scanner) scan() token.Token { s.error('@VMOD_FILE can be used only in projects, that have v.mod file') } vmod_content := os.read_file(vmod_file_location.vmod_file) or {''} - s.vmod_file_content = vmod_content + $if windows { + s.vmod_file_content = vmod_content.replace('\r\n', '\n') + } $else { + s.vmod_file_content = vmod_content + } } return s.new_token(.string, s.vmod_file_content, 10) }