Patch for FilePlugin - bug 3649

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Patch for FilePlugin - bug 3649

Tony Garnock-Jones-2
Hi Ian.

I've found and fixed a problem in the Unix FilePlugin regarding
directory deletion. The problem is already covered by a test case in the
3.8 and 3.9 images. A description of the fault is here:
http://bugs.impara.de/view.php?id=3649 and I've attached the patch
against SVN trunk.

Regards,
  Tony

Index: platforms/unix/plugins/FilePlugin/sqUnixFile.c
===================================================================
--- platforms/unix/plugins/FilePlugin/sqUnixFile.c (revision 1509)
+++ platforms/unix/plugins/FilePlugin/sqUnixFile.c (working copy)
@@ -122,6 +122,12 @@
     return false;
   if (!sq2uxPath(pathString, pathStringLength, name, MAXPATHLEN, 1))
     return false;
+  if (lastPathValid && !strcmp(lastPath, name)) {
+    closedir(openDir);
+    lastPathValid = false;
+    lastIndex = -1;
+    lastPath[0] = '\0';
+  }
   return rmdir(name) == 0;
 }
 
Reply | Threaded
Open this post in threaded view
|

Re: Patch for FilePlugin - bug 3649

johnmci
Does anyone know if this testcase works ok on the mac using the  
3.8.12 VM?

On 18-May-06, at 4:17 AM, Tony Garnock-Jones wrote:

> Hi Ian.
>
> I've found and fixed a problem in the Unix FilePlugin regarding
> directory deletion. The problem is already covered by a test case  
> in the
> 3.8 and 3.9 images. A description of the fault is here:
> http://bugs.impara.de/view.php?id=3649 and I've attached the patch
> against SVN trunk.
>
> Regards,
>   Tony
> Index: platforms/unix/plugins/FilePlugin/sqUnixFile.c
> ===================================================================
> --- platforms/unix/plugins/FilePlugin/sqUnixFile.c (revision 1509)
> +++ platforms/unix/plugins/FilePlugin/sqUnixFile.c (working copy)
> @@ -122,6 +122,12 @@
>      return false;
>    if (!sq2uxPath(pathString, pathStringLength, name, MAXPATHLEN, 1))
>      return false;
> +  if (lastPathValid && !strcmp(lastPath, name)) {
> +    closedir(openDir);
> +    lastPathValid = false;
> +    lastIndex = -1;
> +    lastPath[0] = '\0';
> +  }
>    return rmdir(name) == 0;
>  }
>

--
========================================================================
===
John M. McIntosh <[hidden email]> 1-800-477-2659
Corporate Smalltalk Consulting Ltd.  http://www.smalltalkconsulting.com
========================================================================
===

Reply | Threaded
Open this post in threaded view
|

Re: Patch for FilePlugin - bug 3649

johnmci
I think I only do this in dir_Delete, but is that enough?

On 18-May-06, at 12:35 PM, Tony Garnock-Jones wrote:

>>>   lastPath[0] = '\0';

--
========================================================================
===
John M. McIntosh <[hidden email]> 1-800-477-2659
Corporate Smalltalk Consulting Ltd.  http://www.smalltalkconsulting.com
========================================================================
===

Reply | Threaded
Open this post in threaded view
|

Re: Patch for FilePlugin - bug 3649

johnmci
try looking in
sqMacUnixFileInterface.c

On 18-May-06, at 12:42 PM, Tony Garnock-Jones wrote:

> John M McIntosh wrote:
>> I think I only do this in dir_Delete, but is that enough?
>>>>>   lastPath[0] = '\0';
>
> Perhaps set lastPathValid = false? I'm seeing that happen in the  
> carbon
> version of dir_Delete, but no mention of lastPath or lastPathValid at
> all in the non-carbon version of dir_Delete.
>
> This is the SVN head, of course, since I haven't looked hard enough to
> find a more appropriate source for the Mac OS plugin code :-)
>
> Tony

--
========================================================================
===
John M. McIntosh <[hidden email]> 1-800-477-2659
Corporate Smalltalk Consulting Ltd.  http://www.smalltalkconsulting.com
========================================================================
===