make VfsMatchInDirectory more robust to NULL interps
authorVince Darley <vincentdarley@sourceforge.net>
Sun, 21 Aug 2005 22:37:19 +0000 (22:37 +0000)
committerVince Darley <vincentdarley@sourceforge.net>
Sun, 21 Aug 2005 22:37:19 +0000 (22:37 +0000)
ChangeLog
generic/vfs.c

index 75a31c495089968f4a67396576d731db08607cc6..1a0af64782047db3c3a9f074c264a7361a7db862 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2004-09-28  Vince Darley <vincentdarley@sourceforge.net>
+
+       * generic/vfs.c: despite lack of documentation on this point,
+       VfsMatchInDirectory should really allow a NULL interp, even in
+       error situations.
+
 2005-03-18  Jeff Hobbs  <jeffh@ActiveState.com>
 
        * Makefile.in (AR): use @AR@
index af58892c37f716249696fe069f7d0fdfd89b6c9c..7db4160fef44c2b14a7fc96cec40b9608523c265 100644 (file)
@@ -1554,7 +1554,11 @@ VfsMatchInDirectory(
                Tcl_ListObjAppendList(cmdInterp, returnPtr, vfsResultPtr);
                Tcl_DecrRefCount(vfsResultPtr);
            } else {
-               Tcl_SetObjResult(cmdInterp, vfsResultPtr);
+               if (cmdInterp != NULL) {
+                   Tcl_SetObjResult(cmdInterp, vfsResultPtr);
+               } else {
+                   Tcl_DecrRefCount(vfsResultPtr);
+               }
            }
        }
        return returnVal;