From 912933a62fb7a70ad17567dbdcb5e26e78c12b88 Mon Sep 17 00:00:00 2001 From: Ruvim Date: Sun, 4 Oct 2020 16:17:13 +0300 Subject: [PATCH] UPD src compile.bat -- autoconfigure unix lines Improvements in the 'compile.bat' script: - automatically set line endings mode into UNIX-LINES in the host Forth system if the line endings in the working directory are LF. - change the current directory to 'src' independently of the current directory. --- src/compile.bat | 4 ++-- src/tc-configure-lines.f | 5 +++++ 2 files changed, 7 insertions(+), 2 deletions(-) create mode 100644 src/tc-configure-lines.f diff --git a/src/compile.bat b/src/compile.bat index 9c628be3e..4697a3981 100755 --- a/src/compile.bat +++ b/src/compile.bat @@ -1,3 +1,3 @@ -cd .. +cd /d %~dp0 && cd .. @echo Wait a bit while compiling... -@jpf375c.exe src\spf.f +@jpf375c.exe src\tc-configure-lines.f src\spf.f diff --git a/src/tc-configure-lines.f b/src/tc-configure-lines.f new file mode 100644 index 000000000..e5e25e261 --- /dev/null +++ b/src/tc-configure-lines.f @@ -0,0 +1,5 @@ +SOURCE + 1 CHARS - C@ 0xA = CHAR | AND PARSE | UNIX-LINES +2DROP +\ If the last character in the buffer is LF (0xA) +\ then this file has LF line endigns and the current mode is not UNIX-LINES. +\ Perform UNIX-LINES in this case. Otherwise do nothing.