diff options
author | vincentdarley <vincentdarley> | 2002-06-13 09:39:58 (GMT) |
---|---|---|
committer | vincentdarley <vincentdarley> | 2002-06-13 09:39:58 (GMT) |
commit | 3db3abd0e6cfd42d48f513b1b4e7640fbb47c7c6 (patch) | |
tree | bf267b96362f0e9d923d36bea51aa6f4a245f873 /unix | |
parent | 49a14aec1a0aca882321df160ad18576749c19c4 (diff) | |
download | tcl-3db3abd0e6cfd42d48f513b1b4e7640fbb47c7c6.zip tcl-3db3abd0e6cfd42d48f513b1b4e7640fbb47c7c6.tar.gz tcl-3db3abd0e6cfd42d48f513b1b4e7640fbb47c7c6.tar.bz2 |
vfs, winfs testsuite
Diffstat (limited to 'unix')
-rw-r--r-- | unix/tclUnixFile.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/unix/tclUnixFile.c b/unix/tclUnixFile.c index cdd6697..9edd47e 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.22 2002/06/12 15:05:20 dkf Exp $ + * RCS: @(#) $Id: tclUnixFile.c,v 1.23 2002/06/13 09:40:01 vincentdarley Exp $ */ #include "tclInt.h" @@ -724,9 +724,10 @@ TclpObjStat(pathPtr, bufPtr) #ifdef S_IFLNK Tcl_Obj* -TclpObjLink(pathPtr, toPtr) +TclpObjLink(pathPtr, toPtr, linkType) Tcl_Obj *pathPtr; Tcl_Obj *toPtr; + int linkType; { extern Tcl_Filesystem nativeFilesystem; @@ -737,11 +738,14 @@ TclpObjLink(pathPtr, toPtr) if (src == NULL || target == NULL) { return NULL; } - if (symlink(src, target) != 0) { - return NULL; + /* We don't recognise these codes */ + if (linkType < 0 || linkType > 2) return NULL; + if (linkType == 2) { + if (link(src, target) != 0) return NULL; } else { - return toPtr; + if (symlink(src, target) != 0) return NULL; } + return toPtr; } else { Tcl_Obj* linkPtr = NULL; |