-
-#if 1 // Installer workaround (2940423)
- // hack to get around installer problems when the installer expects search results
- // to be in key order. At this point the problem appears to be limited to
- // searches for "Library". The idea here is to go get the "Library" at root
- // and return it first to the caller then continue the search as normal with
- // the exception of taking care not to return a duplicate hit (see CheckCriteria)
- if ( err == E_NONE &&
- (ap->a_searchattrs->commonattr & ATTR_CMN_NAME) != 0 &&
- IsTargetName( &searchInfo1, isHFSPlus ) )
- {
- CatalogRecord rec;
- BTreeIterator iterator;
- FSBufferDescriptor btrec;
- CatalogKey * keyp;
- UInt16 reclen;
- OSErr result;
-
- bzero( (caddr_t)&iterator, sizeof( iterator ) );
- keyp = (CatalogKey *) &iterator.key;
- (void) BuildCatalogKeyUTF8(vcb, kRootDirID, "Library", kUndefinedStrLen, keyp, NULL);
-
- btrec.bufferAddress = &rec;
- btrec.itemCount = 1;
- btrec.itemSize = sizeof( rec );
-
- result = BTSearchRecord( catalogFCB, &iterator, &btrec, &reclen, &iterator );
- if ( result == E_NONE ) {
- if (CheckCriteria(vcb, ap->a_options, ap->a_searchattrs, &rec,
- keyp, &searchInfo1, &searchInfo2, false) &&
- CheckAccess(vcb, keyp, ap->a_uio->uio_procp)) {
-
- result = InsertMatch(ap->a_vp, ap->a_uio, &rec,
- keyp, ap->a_returnattrs,
- attributesBuffer, variableBuffer,
- eachReturnBufferSize, ap->a_nummatches);
- if (result == E_NONE && *(ap->a_nummatches) >= ap->a_maxmatches)
- doQuickExit = true;
- }
- }