diff options
author | vincentdarley <vincentdarley> | 2002-07-18 16:17:43 (GMT) |
---|---|---|
committer | vincentdarley <vincentdarley> | 2002-07-18 16:17:43 (GMT) |
commit | 20201e313950ca2b4b8af678b6527c4c14c8f7c5 (patch) | |
tree | 1b38c2e75ef177ad7d9cb8ee07a48254d5f218eb | |
parent | ac016ab108f10eb41a68b7d6b086143b2f8241b0 (diff) | |
download | tcl-20201e313950ca2b4b8af678b6527c4c14c8f7c5.zip tcl-20201e313950ca2b4b8af678b6527c4c14c8f7c5.tar.gz tcl-20201e313950ca2b4b8af678b6527c4c14c8f7c5.tar.bz2 |
fix to knownBug test
-rw-r--r-- | ChangeLog | 6 | ||||
-rw-r--r-- | generic/tclFCmd.c | 14 | ||||
-rw-r--r-- | tests/fileSystem.test | 2 |
3 files changed, 19 insertions, 3 deletions
@@ -4,7 +4,11 @@ * generic/tcl.h: * */*Load*.c: added comments on changes of 07/17 and replaced clientData with TclLoadHandle in all locations. - + + * generic/tclFCmd.c: + * tests/fileSystem.test: fixed a 'knownBug' with 'file + attributes ""' + 2002-07-17 Miguel Sofer <msofer@users.sourceforge.net> * generic/tclBasic.c (CallCommandTraces): delete traces now diff --git a/generic/tclFCmd.c b/generic/tclFCmd.c index cc920ce..e027977 100644 --- a/generic/tclFCmd.c +++ b/generic/tclFCmd.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: tclFCmd.c,v 1.17 2002/03/24 11:41:50 vincentdarley Exp $ + * RCS: @(#) $Id: tclFCmd.c,v 1.18 2002/07/18 16:17:48 vincentdarley Exp $ */ #include "tclInt.h" @@ -828,11 +828,23 @@ TclFileAttrsCmd(interp, objc, objv) objc -= 3; objv += 3; result = TCL_ERROR; + Tcl_SetErrno(0); attributeStrings = Tcl_FSFileAttrStrings(filePtr, &objStrings); if (attributeStrings == NULL) { int index; Tcl_Obj *objPtr; if (objStrings == NULL) { + if (Tcl_GetErrno() != 0) { + /* + * There was an error, probably that the filePtr is + * not accepted by any filesystem + */ + Tcl_AppendStringsToObj(Tcl_GetObjResult(interp), + "could not read \"", Tcl_GetString(filePtr), + "\": ", Tcl_PosixError(interp), + (char *) NULL); + return TCL_ERROR; + } goto end; } /* We own the object now */ diff --git a/tests/fileSystem.test b/tests/fileSystem.test index 2c44fca..2185dbf 100644 --- a/tests/fileSystem.test +++ b/tests/fileSystem.test @@ -266,7 +266,7 @@ test filesystem-6.3 {empty file name} { list [catch {file atime ""} msg] $msg } {1 {could not read "": no such file or directory}} -test filesystem-6.4 {empty file name} {knownBug} { +test filesystem-6.4 {empty file name} { list [catch {file attributes ""} msg] $msg } {1 {could not read "": no such file or directory}} |