Index: trunk/src/plug_footprint.c =================================================================== --- trunk/src/plug_footprint.c (revision 36002) +++ trunk/src/plug_footprint.c (revision 36003) @@ -347,6 +347,16 @@ pcb_fp_sort_children(v->array[n]); } +/* Sort each children but keep configured order of roots. */ +void pcb_fp_sort_lib(void) +{ + int n; + vtp0_t *v = &pcb_library.data.dir.children; + + for(n = 0; n < vtp0_len(v); n++) + pcb_fp_sort_children(v->array[n]); +} + void fp_free_entry(pcb_fplibrary_t *l) { switch(l->type) { @@ -488,9 +498,10 @@ { FILE *resultFP = NULL; - /* List all footprint libraries. Then sort the whole library. */ + /* List all footprint libraries. Sort each children but keep configured + order of roots. */ if (fp_read_lib_all_(&conf_core.rc.library_search_paths) > 0 || resultFP != NULL) { - pcb_fp_sort_children(&pcb_library); + pcb_fp_sort_lib(); return 0; } @@ -519,7 +530,7 @@ path = rnd_strdup(l->name); pcb_fp_rmdir(l); res = be->load_dir(be, path, 1); - pcb_fp_sort_children(&pcb_library); + pcb_fp_sort_lib(); free(path); if (res >= 0) { Index: trunk/src/plug_footprint.h =================================================================== --- trunk/src/plug_footprint.h (revision 36002) +++ trunk/src/plug_footprint.h (revision 36003) @@ -118,7 +118,7 @@ extern pcb_fplibrary_t pcb_library; /* the footprint library */ void pcb_fp_free_children(pcb_fplibrary_t *parent); -void pcb_fp_sort_children(pcb_fplibrary_t *parent); +void pcb_fp_sort_lib(void); void pcb_fp_rmdir(pcb_fplibrary_t *dir); pcb_fplibrary_t *pcb_fp_mkdir_p(const char *path); pcb_fplibrary_t *pcb_fp_mkdir_len(pcb_fplibrary_t *parent, const char *name, int name_len);