diff options
| -rw-r--r-- | doc/try.n | 2 | ||||
| -rw-r--r-- | generic/tclExecute.c | 6 |
2 files changed, 4 insertions, 4 deletions
@@ -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; } } |
