merge to tip after backout
authorShawn Wilsher <me@shawnwilsher.com>
Fri, 28 Nov 2008 16:13:37 -0800
changeset 22114 5f86a34bc7981dd999ad7f9e2aac1471e11bde14
parent 22112 aadde428c8ce836b8c9f8ddaee8f3e53b6548696 (current diff)
parent 22113 5d192e3eee829d162556c9ba7391222c32967154 (diff)
child 22116 c927c0929dccf092138ca8f5fc896bd9cfaa7dab
push idunknown
push userunknown
push dateunknown
milestone1.9.1b3pre
merge to tip after backout
--- a/modules/libreg/src/Makefile.in
+++ b/modules/libreg/src/Makefile.in
@@ -42,16 +42,21 @@ VPATH		= @srcdir@
 
 include $(DEPTH)/config/autoconf.mk
 include $(srcdir)/objs.mk
 
 MODULE		= libreg
 LIBRARY_NAME	= mozreg_s
 DIST_INSTALL = 1
 
+# MacOSX requires the MoreFiles module
+ifeq ($(OS_ARCH),Darwin)
+REQUIRES = macmorefiles
+endif
+
 CSRCS		= $(MODULES_LIBREG_SRC_LCSRCS) nr_bufio.c
 
 BIN_SRCS	= VerReg.c reg.c vr_stubs.c
 PROGOBJS        = $(addprefix R_,$(BIN_SRCS:.c=.o))
 
 # We don't want a shared lib.  Static lib only.
 FORCE_STATIC_LIB = 1
 
@@ -60,16 +65,20 @@ FORCE_USE_PIC	= 1
 
 # We do want this in the static libraries list
 EXPORT_LIBRARY = 1
 
 USE_STATIC_LIBS = 1
 
 SDK_LIBRARY = $(LIBRARY)
 
+ifeq (cocoa,$(MOZ_WIDGET_TOOLKIT))
+SHARED_LIBRARY_LIBS += $(DEPTH)/xpcom/MoreFiles/libmacmorefiles_s.a
+endif
+
 include $(topsrcdir)/config/config.mk
 
 DEFINES         += -DUSE_BUFFERED_REGISTRY_IO	
 # Memory mapped files are not supported under QNX, Neutrino, HP-UX and BeOS
 #ifeq (,$(filter BeOS HP-UX QNX,$(OS_ARCH)))
 #CSRCS		+= mmapio.c
 #DEFINES		+= -DUSE_MMAP_REGISTRY_IO
 #endif
--- a/modules/libreg/src/reg.c
+++ b/modules/libreg/src/reg.c
@@ -146,21 +146,26 @@
 static PRLock   *reglist_lock = NULL;
 #endif
 
 static REGFILE  *RegList = NULL;
 static int32    regStartCount = 0;
 char            *globalRegName = NULL;
 static char     *user_name = NULL;
 
+
+
+
 #ifdef XP_MACOSX
 
 void nr_MacAliasFromPath(const char * fileName, void ** alias, int32 * length);
 char * nr_PathFromMacAlias(const void * alias, uint32 aliasLength);
 
+#include "MoreFilesX.h"
+
 static void copyCStringToPascal(Str255 dest, const char *src)
 {
     size_t copyLen = strlen(src);
     if (copyLen > 255)
         copyLen = 255;
     BlockMoveData(src, &dest[1], copyLen);
     dest[0] = copyLen;
 }
@@ -176,19 +181,19 @@ static OSErr isFileInTrash(FSRef *fsRef,
 
     err = FSGetCatalogInfo(fsRef, kFSCatInfoVolume, &catalogInfo, NULL, NULL, NULL);
     if (err == noErr)
     {
         FSRef trashFSRef, currFSRef, parentFSRef;
         err = FSFindFolder(catalogInfo.volume, kTrashFolderType, false, &trashFSRef);
         if (err == noErr)
         {
+            /* FSRefGetParentRef returns noErr and a zeroed FSRef when it reaches the top */
             for (currFSRef = *fsRef;
-                 (FSGetCatalogInfo(&currFSRef, kFSCatInfoNodeID, NULL, NULL, NULL, &parentFSRef) == noErr &&
-                  FSGetCatalogInfo(&parentFSRef, kFSCatInfoNone, NULL, NULL, NULL, NULL) == noErr);
+                 (FSGetParentRef(&currFSRef, &parentFSRef) == noErr && FSRefValid(&parentFSRef));
                  currFSRef = parentFSRef)
             {
                 if (FSCompareFSRefs(&parentFSRef, &trashFSRef) == noErr)
                 {
                     *inTrash = PR_TRUE;
                     break;
                 }
             }
--- a/modules/libreg/standalone/Makefile.in
+++ b/modules/libreg/standalone/Makefile.in
@@ -42,16 +42,21 @@ srcdir		= @srcdir@
 VPATH		= @srcdir@
 
 include $(DEPTH)/config/autoconf.mk
 include $(srcdir)/../src/objs.mk
 
 MODULE		= libreg
 LIBRARY_NAME	= mozregsa_s
 
+# MacOSX requires the MoreFiles module
+ifeq ($(OS_ARCH),Darwin)
+REQUIRES = macmorefiles
+endif
+
 ifeq ($(OS_ARCH),WINNT)
 USE_STATIC_LIBS = 1
 endif
 
 CSRCS		= $(MODULES_LIBREG_SRC_LCSRCS)
 
 FORCE_STATIC_LIB = 1