summaryrefslogtreecommitdiffstats
path: root/library/readfile.tcl
diff options
context:
space:
mode:
authordkf <donal.k.fellows@manchester.ac.uk>2023-05-31 10:33:01 (GMT)
committerdkf <donal.k.fellows@manchester.ac.uk>2023-05-31 10:33:01 (GMT)
commit38c9c34398bc61793d4794a1c4dadb3a36f23847 (patch)
tree60950a8e49337252996f44d01e2adcfb7292ae94 /library/readfile.tcl
parentd3acda84955821249bc38d697afe3cc890ac1bf2 (diff)
downloadtcl-38c9c34398bc61793d4794a1c4dadb3a36f23847.zip
tcl-38c9c34398bc61793d4794a1c4dadb3a36f23847.tar.gz
tcl-38c9c34398bc61793d4794a1c4dadb3a36f23847.tar.bz2
Swapped foreachLine arg order, improved docs
Diffstat (limited to 'library/readfile.tcl')
-rw-r--r--library/readfile.tcl2
1 files changed, 1 insertions, 1 deletions
diff --git a/library/readfile.tcl b/library/readfile.tcl
index 350bcd4..c1d5b84 100644
--- a/library/readfile.tcl
+++ b/library/readfile.tcl
@@ -14,7 +14,7 @@ proc readFile {filename {mode text}} {
set mode [tcl::prefix match -message "mode" -error $ERR $MODES $mode]
# Read the file
- set f [open $filename [expr {$mode eq "text" ? "r" : "rb"}]]
+ set f [open $filename [dict get {text r binary rb} $mode]]
try {
return [read $f]
} finally {