- /* Now scan FinderInfo if its all 0 */
- count = 32;
- while (count--) {
- if (*FinderInfo++) {
- /* FinderInfo contains some non 0 bytes -> include "com.apple.FinderInfo" */
- strcpy(attrnamebuf, ea_finderinfo);
- attrbuflen += strlen(ea_finderinfo) + 1;
- LOG(log_debug7, logtype_afpd, "afp_listextattr(%s): sending com.apple.FinderInfo", uname);
- break;
- }
+ if ((adflags & ADFLAGS_DIR)) {
+ /* set default view */
+ uint16 = htons(FINDERINFO_CLOSEDVIEW);
+ memcpy(emptyFinderInfo + FINDERINFO_FRVIEWOFF, &uint16, 2);
+ }
+
+ /* Check if FinderInfo equals default and empty FinderInfo*/
+ if ((memcmp(FinderInfo, emptyFinderInfo, 32)) != 0) {
+ /* FinderInfo contains some non 0 bytes -> include "com.apple.FinderInfo" */
+ strcpy(attrnamebuf, ea_finderinfo);
+ attrbuflen += strlen(ea_finderinfo) + 1;
+ LOG(log_debug7, logtype_afpd, "afp_listextattr(%s): sending com.apple.FinderInfo", uname);