Index: trunk/src/conf.h =================================================================== --- trunk/src/conf.h (revision 20363) +++ trunk/src/conf.h (revision 20364) @@ -287,7 +287,7 @@ const char **__in__ = __n__->val.string; \ if (__in__ == NULL) \ continue; \ - pcb_path_resolve(*__in__, &__path__, 0); \ + pcb_path_resolve(*__in__, &__path__, 0, pcb_false); \ res = call; \ free(__path__); \ if (res == 0) \ Index: trunk/src/hid_cfg.c =================================================================== --- trunk/src/hid_cfg.c (revision 20363) +++ trunk/src/hid_cfg.c (revision 20364) @@ -302,7 +302,7 @@ int fn_len = strlen(fn); doc = NULL; - pcb_paths_resolve_all(hid_cfg_paths_in, paths, fn_len+32); + pcb_paths_resolve_all(hid_cfg_paths_in, paths, fn_len+32, pcb_false); for(p = paths; *p != NULL; p++) { if (doc == NULL) { char *end = *p + strlen(*p); Index: trunk/src/paths.c =================================================================== --- trunk/src/paths.c (revision 20363) +++ trunk/src/paths.c (revision 20364) @@ -206,7 +206,8 @@ char path[256], *q; size_t len = end - start; if (len > sizeof(path) - 1) { - pcb_message(PCB_MSG_ERROR, "pcb_strdup_subst(): can't resolve $() conf var, name too long: %s\n", start); + if (!(flags & PCB_SUBST_QUIET)) + pcb_message(PCB_MSG_ERROR, "pcb_strdup_subst(): can't resolve $() conf var, name too long: %s\n", start); goto error; } memcpy(path, start, len); @@ -216,11 +217,13 @@ *q = '/'; cn = conf_get_field(path); if (cn == NULL) { - pcb_message(PCB_MSG_ERROR, "pcb_strdup_subst(): can't resolve $(%s) conf var: not found in the conf tree\n", path); + if (!(flags & PCB_SUBST_QUIET)) + pcb_message(PCB_MSG_ERROR, "pcb_strdup_subst(): can't resolve $(%s) conf var: not found in the conf tree\n", path); goto error; } if (cn->type != CFN_STRING) { - pcb_message(PCB_MSG_ERROR, "pcb_strdup_subst(): can't resolve $(%s) conf var: value type is not string\n", path); + if (!(flags & PCB_SUBST_QUIET)) + pcb_message(PCB_MSG_ERROR, "pcb_strdup_subst(): can't resolve $(%s) conf var: value type is not string\n", path); goto error; } if (cn->val.string[0] != NULL) @@ -228,7 +231,8 @@ curr = end+1; } else { - pcb_message(PCB_MSG_ERROR, "pcb_strdup_subst(): unterminated $(%s)\n", start); + if (!(flags & PCB_SUBST_QUIET)) + pcb_message(PCB_MSG_ERROR, "pcb_strdup_subst(): unterminated $(%s)\n", start); goto error; } break; @@ -276,21 +280,24 @@ return pcb_strdup_subst_(template, cb, ctx, flags, 0); } -void pcb_paths_resolve(const char **in, char **out, int numpaths, unsigned int extra_room) +void pcb_paths_resolve(const char **in, char **out, int numpaths, unsigned int extra_room, int quiet) { + pcb_strdup_subst_t flags = PCB_SUBST_ALL; + if (quiet) + flags |= PCB_SUBST_QUIET; for (; numpaths > 0; numpaths--, in++, out++) - *out = pcb_strdup_subst_(*in, pcb_build_fn_cb, NULL, PCB_SUBST_ALL, extra_room); + *out = pcb_strdup_subst_(*in, pcb_build_fn_cb, NULL, flags, extra_room); } -void pcb_path_resolve(const char *in, char **out, unsigned int extra_room) +void pcb_path_resolve(const char *in, char **out, unsigned int extra_room, int quiet) { - pcb_paths_resolve(&in, out, 1, extra_room); + pcb_paths_resolve(&in, out, 1, extra_room, quiet); } -char *pcb_path_resolve_inplace(char *in, unsigned int extra_room) +char *pcb_path_resolve_inplace(char *in, unsigned int extra_room, int quiet) { char *out; - pcb_path_resolve(in, &out, extra_room); + pcb_path_resolve(in, &out, extra_room, quiet); free(in); return out; } Index: trunk/src/paths.h =================================================================== --- trunk/src/paths.h (revision 20363) +++ trunk/src/paths.h (revision 20364) @@ -30,24 +30,25 @@ /* Allocate *out and copy the path from in to out, replacing ~ with conf_core.rc.path.home If extra_room is non-zero, allocate this many bytes extra for each slot; - this leaves some room to append a file name. */ -void pcb_path_resolve(const char *in, char **out, unsigned int extra_room); + this leaves some room to append a file name. If quiet is non-zero, suppress + error messages. */ +void pcb_path_resolve(const char *in, char **out, unsigned int extra_room, int quiet); /* Same as resolve_path, but it returns the pointer to the new path and calls free() on in */ -char *pcb_path_resolve_inplace(char *in, unsigned int extra_room); +char *pcb_path_resolve_inplace(char *in, unsigned int extra_room, int quiet); /* Resolve all paths from a in[] into out[](should be large enough) */ -void pcb_paths_resolve(const char **in, char **out, int numpaths, unsigned int extra_room); +void pcb_paths_resolve(const char **in, char **out, int numpaths, unsigned int extra_room, int quiet); /* Resolve all paths from a char *in[] into a freshly allocated char **out */ -#define pcb_paths_resolve_all(in, out, extra_room) \ +#define pcb_paths_resolve_all(in, out, extra_room, quiet) \ do { \ int __numpath__ = sizeof(in) / sizeof(char *); \ if (__numpath__ > 0) { \ out = malloc(sizeof(char *) * __numpath__); \ - pcb_paths_resolve(in, out, __numpath__, extra_room); \ + pcb_paths_resolve(in, out, __numpath__, extra_room, quiet); \ } \ } while(0) Index: trunk/src/pcb-printf.h =================================================================== --- trunk/src/pcb-printf.h (revision 20363) +++ trunk/src/pcb-printf.h (revision 20364) @@ -150,7 +150,9 @@ PCB_SUBST_CONF = 4, PCB_SUBST_BACKSLASH = 8, /* substitute \ sequences as printf(3) does */ - PCB_SUBST_ALL = 0xff + PCB_SUBST_ALL = 0x7f, /* substitute all, but do not enable quiet */ + + PCB_SUBST_QUIET = 0x80 } pcb_strdup_subst_t; /* Substitute template using cb, leaving extra room at the end and append the Index: trunk/src/plug_io.c =================================================================== --- trunk/src/plug_io.c (revision 20363) +++ trunk/src/plug_io.c (revision 20364) @@ -483,7 +483,7 @@ start = clock(); #endif - pcb_path_resolve(Filename, &new_filename, 0); + pcb_path_resolve(Filename, &new_filename, 0, pcb_false); oldPCB = PCB; PCB = newPCB; Index: trunk/src_plugins/dialogs/dlg_pref_lib.c =================================================================== --- trunk/src_plugins/dialogs/dlg_pref_lib.c (revision 20363) +++ trunk/src_plugins/dialogs/dlg_pref_lib.c (revision 20364) @@ -89,7 +89,7 @@ conf_loop_list_str(&conf_core.rc.library_search_paths, i, s, idx) { char *tmp; cell[0] = pcb_strdup(i->payload); - pcb_path_resolve(cell[0], &tmp, 0); + pcb_path_resolve(cell[0], &tmp, 0, pcb_false); cell[1] = pcb_strdup(tmp); cell[2] = pcb_strdup((i->prop.src->file_name == NULL ? SRC_BRD : i->prop.src->file_name)); cell[3] = NULL; @@ -230,7 +230,7 @@ cell_edit_ctx_t *ctx = caller_data; char *tmp; - pcb_path_resolve(ctx->dlg[ctx->wpath].default_val.str_value, &tmp, 0); + pcb_path_resolve(ctx->dlg[ctx->wpath].default_val.str_value, &tmp, 0, pcb_true); if (tmp != NULL) PCB_DAD_SET_VALUE(hid_ctx, ctx->wexp, str_value, tmp); } Index: trunk/src_plugins/fp_fs/fp_fs.c =================================================================== --- trunk/src_plugins/fp_fs/fp_fs.c (revision 20363) +++ trunk/src_plugins/fp_fs/fp_fs.c (revision 20364) @@ -228,7 +228,7 @@ sprintf(working_, "%s%c%s", toppath, PCB_DIR_SEPARATOR_C, subdir); - pcb_path_resolve(working_, &working, 0); + pcb_path_resolve(working_, &working, 0, pcb_false); /* Return error if the root is not a directory, to give other fp_ plugins a chance */ if ((is_root) && (!pcb_is_dir(working))) { @@ -326,7 +326,7 @@ memcpy(path, p, end - p); path[end - p] = '\0'; - pcb_path_resolve(path, &fpath, 0); + pcb_path_resolve(path, &fpath, 0, pcb_false); /* fprintf(stderr, " in '%s'\n", fpath);*/ fp_fs_list(&pcb_library, fpath, 1, fp_search_cb, &ctx, 1, 0); Index: trunk/src_plugins/gpmi/pcb-gpmi/gpmi_plugin/gpmi_plugin.c =================================================================== --- trunk/src_plugins/gpmi/pcb-gpmi/gpmi_plugin/gpmi_plugin.c (revision 20363) +++ trunk/src_plugins/gpmi/pcb-gpmi/gpmi_plugin/gpmi_plugin.c (revision 20364) @@ -174,9 +174,9 @@ const char *home; void **gpmi_asm_scriptname; - libdirg = pcb_path_resolve_inplace(pcb_concat(PCBLIBDIR, PCB_DIR_SEPARATOR_S "plugins", NULL), 0); - libdirh = pcb_path_resolve_inplace(pcb_concat(PCBLIBDIR, PCB_DIR_SEPARATOR_S "plugins" PCB_DIR_SEPARATOR_S, HOST, NULL), 0); - wdirh = pcb_path_resolve_inplace(pcb_concat("plugins" PCB_DIR_SEPARATOR_S, HOST, NULL), 0); + libdirg = pcb_path_resolve_inplace(pcb_concat(PCBLIBDIR, PCB_DIR_SEPARATOR_S "plugins", NULL), 0, pcb_false); + libdirh = pcb_path_resolve_inplace(pcb_concat(PCBLIBDIR, PCB_DIR_SEPARATOR_S "plugins" PCB_DIR_SEPARATOR_S, HOST, NULL), 0, pcb_false); + wdirh = pcb_path_resolve_inplace(pcb_concat("plugins" PCB_DIR_SEPARATOR_S, HOST, NULL), 0, pcb_false); wdir = pcb_concat("plugins", NULL); home = getenv ("PCB_RND_GPMI_HOME"); @@ -183,7 +183,7 @@ if (home == NULL) home = conf_core.rc.path.home; - hdirh = pcb_path_resolve_inplace(pcb_concat(home, PCB_DIR_SEPARATOR_S ".pcb" PCB_DIR_SEPARATOR_S "plugins" PCB_DIR_SEPARATOR_S, HOST, NULL), 0); + hdirh = pcb_path_resolve_inplace(pcb_concat(home, PCB_DIR_SEPARATOR_S ".pcb" PCB_DIR_SEPARATOR_S "plugins" PCB_DIR_SEPARATOR_S, HOST, NULL), 0, pcb_false); pcb_message(PCB_MSG_DEBUG, "gpmi dirs: lg=%s lh=%s wh=%s w=%s hh=%s\n", libdirg, libdirh, wdirh, wdir, hdirh); @@ -227,7 +227,7 @@ if (home != NULL) { hid_gpmi_load_dir (hdirh, 0); - dir = pcb_path_resolve_inplace(pcb_concat(home, PCB_DIR_SEPARATOR_S ".pcb" PCB_DIR_SEPARATOR_S "plugins", NULL), 0); + dir = pcb_path_resolve_inplace(pcb_concat(home, PCB_DIR_SEPARATOR_S ".pcb" PCB_DIR_SEPARATOR_S "plugins", NULL), 0, pcb_false); hid_gpmi_load_dir(dir, 1); free(dir); } Index: trunk/src_plugins/import_mentor_sch/mentor_sch.c =================================================================== --- trunk/src_plugins/import_mentor_sch/mentor_sch.c (revision 20363) +++ trunk/src_plugins/import_mentor_sch/mentor_sch.c (revision 20364) @@ -141,7 +141,7 @@ conf_loop_list_str(&conf_mentor.plugins.import_mentor_sch.map_search_paths, item, item_str, idx) { char *p; - pcb_path_resolve(item_str, &p, 0); + pcb_path_resolve(item_str, &p, 0, pcb_false); if (p != NULL) { cnt += nethlp_load_part_map(&nhctx, p); free(p); Index: trunk/src_plugins/lib_gtk_config/gui-config.c =================================================================== --- trunk/src_plugins/lib_gtk_config/gui-config.c (revision 20363) +++ trunk/src_plugins/lib_gtk_config/gui-config.c (revision 20364) @@ -786,7 +786,7 @@ { if ((nd != NULL) && (col == 1)) { char *out; - pcb_path_resolve(nd->data.text.value, &out, 0); + pcb_path_resolve(nd->data.text.value, &out, 0, pcb_false); return out; } return NULL;