diff options
author | vincentdarley <vincentdarley> | 2005-08-31 15:12:18 (GMT) |
---|---|---|
committer | vincentdarley <vincentdarley> | 2005-08-31 15:12:18 (GMT) |
commit | 9dffb7863ba4b0e760ce19215def938abecbcfea (patch) | |
tree | 807c9aa089e7e4c4b5f9c102046d5b6780d24a19 /unix | |
parent | 2e73eedbe37a9f715cd90a7428f6d03648491e8a (diff) | |
download | tcl-9dffb7863ba4b0e760ce19215def938abecbcfea.zip tcl-9dffb7863ba4b0e760ce19215def938abecbcfea.tar.gz tcl-9dffb7863ba4b0e760ce19215def938abecbcfea.tar.bz2 |
allow NULL interp in Tcl_FSMatchInDirectory
Diffstat (limited to 'unix')
-rw-r--r-- | unix/tclUnixFile.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/unix/tclUnixFile.c b/unix/tclUnixFile.c index b26691d..39ab6bf 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.45 2005/07/20 23:16:00 dkf Exp $ + * RCS: @(#) $Id: tclUnixFile.c,v 1.46 2005/08/31 15:12:18 vincentdarley Exp $ */ #include "tclInt.h" @@ -288,10 +288,12 @@ TclpMatchInDirectory(interp, resultPtr, pathPtr, pattern, types) d = opendir(native); /* INTL: Native. */ if (d == NULL) { Tcl_DStringFree(&ds); - Tcl_ResetResult(interp); - Tcl_AppendResult(interp, "couldn't read directory \"", - Tcl_DStringValue(&dsOrig), "\": ", - Tcl_PosixError(interp), (char *) NULL); + if (interp != NULL) { + Tcl_ResetResult(interp); + Tcl_AppendResult(interp, "couldn't read directory \"", + Tcl_DStringValue(&dsOrig), "\": ", + Tcl_PosixError(interp), (char *) NULL); + } Tcl_DStringFree(&dsOrig); Tcl_DecrRefCount(fileNamePtr); return TCL_ERROR; |