Index: trunk/src/file.c =================================================================== --- trunk/src/file.c (revision 821) +++ trunk/src/file.c (revision 822) @@ -1227,10 +1227,12 @@ LibraryMenuTypePtr menu = NULL; /* Pointer to PCB's library menu structure */ list_st_t l; list_dir_t *d, *nextd; - char working[MAXPATHLEN + 1]; /* String holding abs path to working dir */ + char working_[MAXPATHLEN + 1]; + char *working; /* String holding abs path to working dir */ int menuidx; - sprintf(working, "%s%c%s", toppath, PCB_DIR_SEPARATOR_C, subdir); + sprintf(working_, "%s%c%s", toppath, PCB_DIR_SEPARATOR_C, subdir); + resolve_path(working_, &working); /* Get pointer to memory holding menu */ menu = GetLibraryMenuMemory (&Library, &menuidx); @@ -1258,6 +1260,7 @@ if (l.children == 0) { DeleteLibraryMenuMemory (&Library, menuidx); } + free(working); return l.children; } Index: trunk/src/libpcb_fp.c =================================================================== --- trunk/src/libpcb_fp.c (revision 821) +++ trunk/src/libpcb_fp.c (revision 822) @@ -321,20 +321,26 @@ ctx.parametric = parametric; ctx.path = NULL; -/* printf("Looking for %s\n", ctx.target);*/ +/* fprintf("Looking for %s\n", ctx.target);*/ for(p = search_path; end = strchr(p, ':'); p = end+1) { + char *fpath; memcpy(path, p, end-p); path[end-p] = '\0'; -/* printf(" in '%s'\n", path);*/ - pcb_fp_list(path, 1, pcb_fp_search_cb, &ctx, 1); + + resolve_path(path, &fpath); +/* fprintf(stderr, " in '%s'\n", fpath);*/ + + pcb_fp_list(fpath, 1, pcb_fp_search_cb, &ctx, 1); if (ctx.path != NULL) { sprintf(path, "%s%c%s", ctx.path, PCB_DIR_SEPARATOR_C, ctx.real_name); free(ctx.path); free(ctx.real_name); -/* printf(" found '%s'\n", path);*/ +/* fprintf(" found '%s'\n", path);*/ + free(fpath); return strdup(path); } + free(fpath); if (end == NULL) break; } @@ -352,10 +358,12 @@ return NULL; fullname = pcb_fp_search(path, basename, *is_parametric); - +/* fprintf(stderr, "basename=%s fullname=%s\n", basename, fullname);*/ /* printf("pcb_fp_fopen: %d '%s' '%s' fullname='%s'\n", *is_parametric, basename, params, fullname);*/ + if (fullname != NULL) { +/*fprintf(stderr, "fullname=%s param=%d\n", fullname, *is_parametric);*/ if (*is_parametric) { char *cmd, *sep = " "; if (libshell == NULL) { @@ -364,6 +372,7 @@ } cmd = malloc(strlen(libshell) + strlen(fullname) + strlen(params) + 16); sprintf(cmd, "%s%s%s %s", libshell, sep, fullname, params); +/*fprintf(stderr, " cmd=%s\n", cmd);*/ f = popen(cmd, "r"); free(cmd); }