summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorandreas_kupries <akupries@shaw.ca>2006-03-16 00:38:50 (GMT)
committerandreas_kupries <akupries@shaw.ca>2006-03-16 00:38:50 (GMT)
commit05b75a0ef0b2ec55a7f535040223d308ca716546 (patch)
tree76bac598f558f0fc85c58d270fe6a7e07b26fe58
parent836e0f347fa1c6847e08d149f0637c308259998f (diff)
downloadtcl-05b75a0ef0b2ec55a7f535040223d308ca716546.zip
tcl-05b75a0ef0b2ec55a7f535040223d308ca716546.tar.gz
tcl-05b75a0ef0b2ec55a7f535040223d308ca716546.tar.bz2
* tests/socket.test: Extended the timeout in socket-11.11 from 10
to 40 seconds to allow for really slow machines. Also extended actual/expected results with value of variable 'done' to make it clearer when a test fails due to a timeout. [Bug 792159]. * generic/tclPipe.c (TclCreatePipeline): Modified the processing of pipebars to fail if the last bar is followed only by redirections. [Bug 768659].
-rw-r--r--ChangeLog13
-rw-r--r--generic/tclPipe.c20
-rw-r--r--tests/socket.test8
3 files changed, 35 insertions, 6 deletions
diff --git a/ChangeLog b/ChangeLog
index c28b724..4466713 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2006-03-15 Andreas Kupries <andreask@activestate.com>
+
+ * tests/socket.test: Extended the timeout in socket-11.11 from 10
+ to 40 seconds to allow for really slow machines. Also extended
+ actual/expected results with value of variable 'done' to make it
+ clearer when a test fails due to a timeout. [Bug 792159].
+
2006-03-15 Vince Darley <vincentdarley@sourceforge.net>
* win/fCmd.test: add proper test constraints so the new
@@ -5,6 +12,12 @@
2006-03-14 Andreas Kupries <andreask@activestate.com>
+ * generic/tclPipe.c (TclCreatePipeline): Modified the processing
+ of pipebars to fail if the last bar is followed only by
+ redirections. [Bug 768659].
+
+2006-03-14 Andreas Kupries <andreask@activestate.com>
+
* doc/fconfigure.n: Clarified that -translation is binary is
reported as lf when queried, because it is identical to lf,
except for the special additional behaviour when setting
diff --git a/generic/tclPipe.c b/generic/tclPipe.c
index b02d91b..bd66ca6 100644
--- a/generic/tclPipe.c
+++ b/generic/tclPipe.c
@@ -9,7 +9,7 @@
* See the file "license.terms" for information on usage and redistribution of
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclPipe.c,v 1.17 2006/01/16 19:38:15 rmax Exp $
+ * RCS: @(#) $Id: tclPipe.c,v 1.18 2006/03/16 00:38:50 andreas_kupries Exp $
*/
#include "tclInt.h"
@@ -485,7 +485,7 @@ TclCreatePipeline(
int errorRelease = 0;
CONST char *p;
CONST char *nextArg;
- int skip, lastBar, lastArg, i, j, atOK, flags, errorToOutput = 0;
+ int skip, lastBar, lastArg, i, j, atOK, flags, needCmd, errorToOutput = 0;
Tcl_DString execBuffer;
TclFile pipeIn;
TclFile curInFile, curOutFile, curErrFile;
@@ -523,6 +523,7 @@ TclCreatePipeline(
lastBar = -1;
cmdCount = 1;
+ needCmd = 1;
for (i = 0; i < argc; i++) {
errorToOutput = 0;
skip = 0;
@@ -541,6 +542,7 @@ TclCreatePipeline(
}
lastBar = i;
cmdCount++;
+ needCmd = 1;
break;
case '<':
@@ -683,6 +685,11 @@ TclCreatePipeline(
}
}
break;
+
+ default:
+ /* Got a command word, not a redirection */
+ needCmd = 0;
+ break;
}
if (skip != 0) {
@@ -694,6 +701,15 @@ TclCreatePipeline(
}
}
+ if (needCmd) {
+ /* We had a bar followed only by redirections. */
+
+ Tcl_SetResult(interp,
+ "illegal use of | or |& in command",
+ TCL_STATIC);
+ goto error;
+ }
+
if (inputFile == NULL) {
if (inputLiteral != NULL) {
/*
diff --git a/tests/socket.test b/tests/socket.test
index 33baa25..0dea1d0 100644
--- a/tests/socket.test
+++ b/tests/socket.test
@@ -10,7 +10,7 @@
# See the file "license.terms" for information on usage and redistribution
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
#
-# RCS: @(#) $Id: socket.test,v 1.38 2005/11/01 15:58:05 dkf Exp $
+# RCS: @(#) $Id: socket.test,v 1.39 2006/03/16 00:38:54 andreas_kupries Exp $
# Running socket tests with a remote server:
# ------------------------------------------
@@ -1304,12 +1304,12 @@ test socket-11.11 {testing spurious events} {socket doTestsWithRemoteServer} {
}
set c [socket $remoteServerIP 2836]
fileevent $c readable "readlittle $c"
- set timer [after 10000 "set done timed_out"]
+ set timer [after 40000 "set done timed_out"]
vwait done
after cancel $timer
sendCommand {close $socket10_13_test_server}
- list $spurious $len
-} {0 2690}
+ list $spurious $len $done
+} {0 2690 1}
test socket-11.12 {testing EOF stickyness} {socket doTestsWithRemoteServer} {
set counter 0