From 5a8a55b2e015c916bca8caba18015187182278c0 Mon Sep 17 00:00:00 2001 From: hobbs Date: Tue, 3 Sep 2002 02:01:41 +0000 Subject: * unix/tclUnixFile.c (TclpObjLink): removed unnecessary/unfreed extra native char*. --- ChangeLog | 6 ++++++ unix/tclUnixFile.c | 17 ++++------------- 2 files changed, 10 insertions(+), 13 deletions(-) diff --git a/ChangeLog b/ChangeLog index 7efdb13..198ecd6 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,11 @@ 2002-09-02 Jeff Hobbs + * unix/tclUnixFile.c (TclpObjLink): removed unnecessary/unfreed + extra native char*. + + * unix/tclUnixChan.c (Tcl_MakeTcpClientChannel): make sure to init + flags field of TcpState ptr to 0. + * unix/configure: * unix/tcl.m4: added 64-bit gcc compilation support on HP-11. [Patch #601051] (martin) diff --git a/unix/tclUnixFile.c b/unix/tclUnixFile.c index 3105d21..0fe97d6 100644 --- a/unix/tclUnixFile.c +++ b/unix/tclUnixFile.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: tclUnixFile.c,v 1.27 2002/07/20 01:01:41 vincentdarley Exp $ + * RCS: @(#) $Id: tclUnixFile.c,v 1.28 2002/09/03 02:01:42 hobbs Exp $ */ #include "tclInt.h" @@ -764,9 +764,8 @@ TclpObjLink(pathPtr, toPtr, linkAction) char link[MAXPATHLEN]; int length; - char *native; Tcl_DString ds; - + if (Tcl_FSGetTranslatedPath(NULL, pathPtr) == NULL) { return NULL; } @@ -774,16 +773,8 @@ TclpObjLink(pathPtr, toPtr, linkAction) if (length < 0) { return NULL; } - - /* - * Allocate and copy the name, taking care since the - * name need not be null terminated. - */ - native = (char*)ckalloc((unsigned)(1+length)); - strncpy(native, link, (unsigned)length); - native[length] = '\0'; - - Tcl_ExternalToUtfDString(NULL, native, length, &ds); + + Tcl_ExternalToUtfDString(NULL, link, length, &ds); linkPtr = Tcl_NewStringObj(Tcl_DStringValue(&ds), Tcl_DStringLength(&ds)); Tcl_DStringFree(&ds); -- cgit v0.12