From 7f344a76839530bac469556758a2e35c34262d05 Mon Sep 17 00:00:00 2001 From: Jean-Claude Wippler Date: Fri, 13 Apr 2007 23:48:21 +0000 Subject: [PATCH] fix line-endings for kitgen use on Windows git-svn-id: svn://svn.equi4.com/kitgen/trunk@1460 9e558909-932a-0410-a563-af77432da1eb --- setupvfs.tcl | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/setupvfs.tcl b/setupvfs.tcl index 1895de1..ef5e7f8 100644 --- a/setupvfs.tcl +++ b/setupvfs.tcl @@ -197,8 +197,25 @@ proc vfscopy {argv} { file mkdir $d } - set n [locatefile $f] - file copy $n $vfs/$f + set src [locatefile $f] + set dest $vfs/$f + + switch -- [file extension $src] { + .tcl - .txt - .msg - .test { + # get line-endings right for text files - this is crucial for boot.tcl + # and several scripts in lib/vlerq4/ which are loaded before vfs works + set fin [open $src r] + set fout [open $dest w] + fcopy $fin $fout + close $fin + close $fout + } + default { + file copy $src $dest + } + } + + file mtime $dest [file mtime $src] } } -- 2.23.0