 			*p = '/';
 		}
 		return TCL_OK;
-	} else if ((c == 'r') && (!_strncmp(argv[1], "rootname", length)) && (length >= 2)) {
-		char *lastSlash;
+	} else if (c == 'r' && !strncmp(argv[1], "rootname", length) && length >= 2) {
 		if (argc != 3) {
 			argv[1] = "rootname";
 			goto not3Args;
 		}
-		p = _strrchr(fileName, '.');
-		lastSlash = _strrchr(fileName, '/');
-		if ((p == NULL) || ((lastSlash != NULL) && (lastSlash > p))) {
+		p = strrchr(fileName, '.');
+		char *lastSlash = strrchr(fileName, '/');
+		if (p == NULL || (lastSlash != NULL && lastSlash > p)) {
 			Tcl_SetResult(interp, fileName, TCL_VOLATILE);
 		} else {
 			*p = 0;

		Tcl_AppendResult(interp, "error closing \"", argv[1], "\": ", Tcl_UnixError(interp), "\n", (char *)NULL);
		result = TCL_ERROR;
	}

	// If the file was a connection to a pipeline, clean up everything associated with the child processes.
#ifndef NO_FORK
	if (filePtr->numPids > 0) {
		if (CleanupChildren(interp, filePtr->numPids, filePtr->pidPtr,
			filePtr->errorId) != TCL_OK) {
				result = TCL_ERROR;
		}
	}
#endif

	_freeFast((char *) filePtr);
	return result;
}

*----------------------------------------------------------------------
*
* Tcl_PutsCmd --
*	This procedure is invoked to process the "puts" Tcl command. See the user documentation for details on what it does.
*
* Results:
*	A standard Tcl result.
*
* Side effects:
*	See the user documentation.
*
*----------------------------------------------------------------------
*/
int Tcl_PutsCmd(ClientData dummy, Tcl_Interp *interp, int argc, char **argv)
{
	int i = 1;
	bool newline = true;
	if (argc >= 2 && !strcmp(argv[1], "-nonewline")) {
		newline = false;
		i++;
	}
	if (i < (argc-3) || i >= argc) {
		Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0], "\" ?-nonewline? ?fileId? string", (char *)NULL);
		return TCL_ERROR;
	}

	// The code below provides backwards compatibility with an old form of the command that is no longer recommended or documented.
	if (i == (argc-3)) {
		if (strncmp(argv[i+2], "nonewline", strlen(argv[i+2]))) {
			Tcl_AppendResult(interp, "bad argument \"", argv[i+2], "\": should be \"nonewline\"", (char *)NULL);
			return TCL_ERROR;
		}
		newline = 0;
	}
	char *fileId;
	if (i == (argc-1)) {
		fileId = "stdout";
	} else {
