summaryrefslogtreecommitdiffstats
path: root/unix
diff options
context:
space:
mode:
authorhobbs <hobbs>2002-09-03 02:01:41 (GMT)
committerhobbs <hobbs>2002-09-03 02:01:41 (GMT)
commit5a8a55b2e015c916bca8caba18015187182278c0 (patch)
treee8b0e30007acf89fdbda00810bf0cb9e927e6494 /unix
parent932468bb63beb53d592b88af2b45c2287a8ad3a2 (diff)
downloadtcl-5a8a55b2e015c916bca8caba18015187182278c0.zip
tcl-5a8a55b2e015c916bca8caba18015187182278c0.tar.gz
tcl-5a8a55b2e015c916bca8caba18015187182278c0.tar.bz2
* unix/tclUnixFile.c (TclpObjLink): removed unnecessary/unfreed
extra native char*.
Diffstat (limited to 'unix')
-rw-r--r--unix/tclUnixFile.c17
1 files changed, 4 insertions, 13 deletions
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);