summaryrefslogtreecommitdiffstats
path: root/unix/tclUnixFile.c
diff options
context:
space:
mode:
Diffstat (limited to 'unix/tclUnixFile.c')
-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);