bug-gnustep
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Bug in NSUser.m - NSSearchPathForDirectoriesInDomains()


From: Roland Schwingel
Subject: Bug in NSUser.m - NSSearchPathForDirectoriesInDomains()
Date: Mon, 21 Jul 2003 13:58:12 +0200
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.3) Gecko/20030312

Hi...

As of the fact that today seems to be the "Send-in-a-bug" day, I also want to contribute to this...

Well...There is a bug in NSUsers NSSearchPathForDirectoriesInDomains() function. This function should return a NSArray containing all directories to search. The function itself builds up a list of directories and then checks this list whether all entries are present in the filesystem.So it should check the presence of each individual directory. Unfortuanately it doesn't check for folders it checks for files (using NSFileManager's -fileExistsAtPath: and not -fileExistsAtPath:isDirectory:) so it cannot succeed here. My attached patch will fix this.

Roland

--- NSUser.m.orig       2003-07-21 13:43:02.000000000 +0200
+++ NSUser.m    2003-07-21 13:46:21.000000000 +0200
@@ -1070,9 +1070,11 @@
 
   for (i = 0; i < count; i++)
     {
+       BOOL    isDir = NO;
+
       path = [paths objectAtIndex: i];
       // remove bad paths
-      if ([fm fileExistsAtPath: path] == NO)
+      if ([fm fileExistsAtPath: path isDirectory:&isDir] == NO && (isDir == 
NO))
         {
           [paths removeObjectAtIndex: i];
          i--;

reply via email to

[Prev in Thread] Current Thread [Next in Thread]