Changeset 462

Show
Ignore:
Timestamp:
05/13/04 23:05:51 (4 years ago)
Author:
morris
Message:

merge file search fix from current

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • wired/branches/unlabeled-1.13.2/wired/files.c

    r441 r462  
    1 /* $Id: files.c,v 1.13 2004/05/06 11:10:37 morris Exp $ */ 
     1/* $Id: files.c,v 1.13.2.1 2004/05/13 21:05:51 morris Exp $ */ 
    22 
    33/* 
     
    658658 
    659659 
    660 void wd_search(char *path, char *query, bool root) { 
     660void wd_search(char *path, char *query, bool root, char *prefix) { 
    661661        struct wd_client        *client = (struct wd_client *) pthread_getspecific(wd_client_key); 
    662662        struct stat                     sb; 
     
    756756                                } 
    757757 
     758                                /* create display path */ 
     759                                if(prefix) { 
     760                                        snprintf(wired_path, sizeof(wired_path), "%s%s", 
     761                                                prefix, 
     762                                                real_path + strlen(path)); 
     763                                } else { 
     764                                        snprintf(wired_path, sizeof(wired_path), "%s%s%s", 
     765                                                cur->fts_path + 1, /* skip '.' */ 
     766                                                cur->fts_path[strlen(cur->fts_path) - 1] == '/' 
     767                                                        ? "" /* skip extra '/' */ 
     768                                                        : "/", 
     769                                                cur->fts_name); 
     770                                } 
     771 
    758772#ifdef HAVE_CORESERVICES_CORESERVICES_H 
    759773                                /* check if the mac alias points to a directory */ 
    760774                                if(alias && S_ISDIR(sb.st_mode)) 
    761                                         wd_search(real_path, query, false); 
     775                                        wd_search(real_path, query, false, wired_path); 
    762776#endif 
    763777 
     
    786800                                        } 
    787801 
    788                                         /* create display path */ 
    789                                         snprintf(wired_path, sizeof(wired_path), "%s%s%s", 
    790                                                 cur->fts_path + 1, /* skip '.' */ 
    791                                                 cur->fts_path[strlen(cur->fts_path) - 1] == '/' 
    792                                                         ? "" /* skip extra '/' */ 
    793                                                         : "/", 
    794                                                 cur->fts_name); 
    795                                          
    796802                                        /* reply a 420 for each file */ 
    797803                                        wd_reply(420, "%s%s%u%s%llu",