summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--doc/try.n2
-rw-r--r--generic/tclExecute.c6
2 files changed, 4 insertions, 4 deletions
diff --git a/doc/try.n b/doc/try.n
index eae4dc7..992dcea 100644
--- a/doc/try.n
+++ b/doc/try.n
@@ -87,7 +87,7 @@ Handle different reasons for a file to not be openable for reading:
.PP
.CS
\fBtry\fR {
- set f [open /some/file/name w]
+ set f [open /some/file/name r]
} \fBtrap\fR {POSIX EISDIR} {} {
puts "failed to open /some/file/name: it's a directory"
} \fBtrap\fR {POSIX ENOENT} {} {
diff --git a/generic/tclExecute.c b/generic/tclExecute.c
index a216a56..f667054 100644
--- a/generic/tclExecute.c
+++ b/generic/tclExecute.c
@@ -5808,10 +5808,10 @@ TEBCresume(
* Handle shifts within the native long range.
*/
- if ((size_t) shift < CHAR_BIT*sizeof(long) && (w1 != 0)
+ if (((size_t) shift < CHAR_BIT*sizeof(long))
&& !((w1>0 ? w1 : ~w1) &
- -(1L<<(CHAR_BIT*sizeof(long) - 1 - shift)))) {
- wResult = w1 << shift;
+ -(1UL<<(CHAR_BIT*sizeof(long) - 1 - shift)))) {
+ wResult = (unsigned long)w1 << shift;
goto wideResultOfArithmetic;
}
}