Index: tclIOCmd.c
===================================================================
RCS file: /cvsroot/tcl/tcl/generic/tclIOCmd.c,v
retrieving revision 1.7.2.1
diff -p -r1.7.2.1 tclIOCmd.c
*** tclIOCmd.c	2001/08/06 22:24:11	1.7.2.1
--- tclIOCmd.c	2002/01/17 19:35:53
*************** Tcl_GetsObjCmd(dummy, interp, objc, objv
*** 228,243 ****
          return TCL_ERROR;
      }
  
!     if (objc == 3) {
! 	/*
! 	 * Variable gets line, interp get bytecount.
! 	 */
! 
! 	linePtr = Tcl_NewObj();
!     }
!     else {
! 	linePtr = Tcl_GetObjResult(interp);
!     }
  
      lineLen = Tcl_GetsObj(chan, linePtr);
      if (lineLen < 0) {
--- 228,234 ----
          return TCL_ERROR;
      }
  
!     linePtr = Tcl_NewObj();
  
      lineLen = Tcl_GetsObj(chan, linePtr);
      if (lineLen < 0) {
*************** Tcl_GetsObjCmd(dummy, interp, objc, objv
*** 261,266 ****
--- 252,259 ----
  	resultPtr = Tcl_GetObjResult(interp);
  	Tcl_SetIntObj(resultPtr, lineLen);
          return TCL_OK;
+     } else {
+ 	Tcl_SetObjResult(interp, linePtr);
      }
      return TCL_OK;
  }
