summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog6
-rw-r--r--generic/tclFCmd.c14
-rw-r--r--tests/fileSystem.test2
3 files changed, 19 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index 6e9a06b..2118d1d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -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}}