From: Jean-Claude Wippler Date: Fri, 13 Apr 2007 23:48:21 +0000 (+0000) Subject: fix line-endings for kitgen use on Windows X-Git-Url: https://privyetmir.co.uk/gitweb.cgi?a=commitdiff_plain;h=7f344a76839530bac469556758a2e35c34262d05;p=kitgen fix line-endings for kitgen use on Windows git-svn-id: svn://svn.equi4.com/kitgen/trunk@1460 9e558909-932a-0410-a563-af77432da1eb --- 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] } }