summaryrefslogtreecommitdiffstats
path: root/win
diff options
context:
space:
mode:
authordkf <donal.k.fellows@manchester.ac.uk>2004-10-06 14:35:20 (GMT)
committerdkf <donal.k.fellows@manchester.ac.uk>2004-10-06 14:35:20 (GMT)
commitfef02ccb49c466401dbf9f765ac5cda88bb370e4 (patch)
tree696def18a2b0ccc9859cac44fe1a2640caf27bf7 /win
parent616da07dd7a068c7095f05d3fe0df30440a26053 (diff)
downloadtcl-fef02ccb49c466401dbf9f765ac5cda88bb370e4.zip
tcl-fef02ccb49c466401dbf9f765ac5cda88bb370e4.tar.gz
tcl-fef02ccb49c466401dbf9f765ac5cda88bb370e4.tar.bz2
More formatting fixes...
Diffstat (limited to 'win')
-rw-r--r--win/tclWinPipe.c38
1 files changed, 18 insertions, 20 deletions
diff --git a/win/tclWinPipe.c b/win/tclWinPipe.c
index 536a730..13e26cd 100644
--- a/win/tclWinPipe.c
+++ b/win/tclWinPipe.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: tclWinPipe.c,v 1.48 2004/05/30 21:57:09 davygrvy Exp $
+ * RCS: @(#) $Id: tclWinPipe.c,v 1.49 2004/10/06 14:35:20 dkf Exp $
*/
#include "tclWinInt.h"
@@ -1214,8 +1214,9 @@ TclpCreateProcess(
tclExePtr = Tcl_NewStringObj(TclpFindExecutable(""), -1);
start = Tcl_GetStringFromObj(tclExePtr, &i);
for (end = start + (i-1); end > start; end--) {
- if (*end == '/')
+ if (*end == '/') {
break;
+ }
}
if (*end != '/') {
Tcl_Panic("no / in executable path name");
@@ -1576,7 +1577,9 @@ BuildCommandLine(
*/
Tcl_DStringAppend(&ds, Tcl_DStringValue(linePtr), -1);
- if (Tcl_DStringLength(linePtr) > 0) Tcl_DStringAppend(&ds, " ", 1);
+ if (Tcl_DStringLength(linePtr) > 0) {
+ Tcl_DStringAppend(&ds, " ", 1);
+ }
for (i = 0; i < argc; i++) {
if (i == 0) {
@@ -1594,7 +1597,7 @@ BuildCommandLine(
Tcl_UniChar ch;
for (start = arg; *start != '\0'; start += count) {
count = Tcl_UtfToUniChar(start, &ch);
- if (Tcl_UniCharIsSpace(ch)) { /* INTL: ISO space. */
+ if (Tcl_UniCharIsSpace(ch)) { /* INTL: ISO space. */
quote = 1;
break;
}
@@ -1605,8 +1608,8 @@ BuildCommandLine(
}
start = arg;
for (special = arg; ; ) {
- if ((*special == '\\') &&
- (special[1] == '\\' || special[1] == '"' || (quote && special[1] == '\0'))) {
+ if ((*special == '\\') && (special[1] == '\\' ||
+ special[1] == '"' || (quote && special[1] == '\0'))) {
Tcl_DStringAppend(&ds, start, (int) (special - start));
start = special;
while (1) {
@@ -1884,8 +1887,7 @@ PipeClose2Proc(
DWORD exitCode;
errorCode = 0;
- if ((!flags || (flags == TCL_CLOSE_READ))
- && (pipePtr->readFile != NULL)) {
+ if ((!flags || flags == TCL_CLOSE_READ) && (pipePtr->readFile != NULL)) {
/*
* Clean up the background thread if necessary. Note that this
* must be done before we can close the file, since the
@@ -1913,8 +1915,8 @@ PipeClose2Proc(
* Wait at most 20 milliseconds for the reader thread to close.
*/
- if (WaitForSingleObject(pipePtr->readThread, 20)
- == WAIT_TIMEOUT) {
+ if (WaitForSingleObject(pipePtr->readThread,
+ 20) == WAIT_TIMEOUT) {
/*
* The thread must be blocked waiting for the pipe to
* become readable in ReadFile(). There isn't a clean way
@@ -1949,9 +1951,7 @@ PipeClose2Proc(
pipePtr->validMask &= ~TCL_READABLE;
pipePtr->readFile = NULL;
}
- if ((!flags || (flags & TCL_CLOSE_WRITE))
- && (pipePtr->writeFile != NULL)) {
-
+ if ((!flags || flags & TCL_CLOSE_WRITE) && (pipePtr->writeFile != NULL)) {
if (pipePtr->writeThread) {
/*
* Wait for the writer thread to finish the current buffer,
@@ -1982,8 +1982,8 @@ PipeClose2Proc(
* Wait at most 20 milliseconds for the reader thread to close.
*/
- if (WaitForSingleObject(pipePtr->writeThread, 20)
- == WAIT_TIMEOUT) {
+ if (WaitForSingleObject(pipePtr->writeThread,
+ 20) == WAIT_TIMEOUT) {
/*
* The thread must be blocked waiting for the pipe to
* consume input in WriteFile(). There isn't a clean way
@@ -2340,8 +2340,7 @@ PipeEventProc(
}
filePtr = (WinFile*) ((PipeInfo*)infoPtr)->readFile;
- if ((infoPtr->watchMask & TCL_READABLE) &&
- (WaitForRead(infoPtr, 0) >= 0)) {
+ if ((infoPtr->watchMask & TCL_READABLE) && (WaitForRead(infoPtr,0) >= 0)) {
if (infoPtr->readFlags & PIPE_EOF) {
mask = TCL_READABLE;
} else {
@@ -2899,9 +2898,8 @@ PipeReaderThread(LPVOID arg)
* we can read a single byte off of the pipe.
*/
- if ((ReadFile(handle, NULL, 0, &count, NULL) == FALSE)
- || (PeekNamedPipe(handle, NULL, 0, NULL, &count,
- NULL) == FALSE)) {
+ if (ReadFile(handle, NULL, 0, &count, NULL) == FALSE ||
+ PeekNamedPipe(handle, NULL, 0, NULL, &count, NULL) == FALSE) {
/*
* The error is a result of an EOF condition, so set the
* EOF bit before signalling the main thread.