Index: trunk/src_plugins/lib_vfs/lib_vfs.c =================================================================== --- trunk/src_plugins/lib_vfs/lib_vfs.c (revision 24083) +++ trunk/src_plugins/lib_vfs/lib_vfs.c (revision 24084) @@ -216,9 +216,7 @@ pcb_layer_t *ly = pcb_get_layer(pcb->Data, lid); if (ly == NULL) return -1; - if (isdir != NULL) - *isdir = 1; - return 0; + goto ret_dir; } if (*end != '/') @@ -233,10 +231,15 @@ } else { char *sep = strchr(path, '/'); - long oid = strtol(sep+1, &end, 10); + long oid; pcb_any_obj_t *obj = NULL; pcb_objtype_t ty; + if (sep == NULL) + goto ret_dir; + + sep = strtol(sep+1, &end, 10); + if ((*end != '/') && (*end != '\0')) return -1; @@ -264,6 +267,11 @@ } return res; + + ret_dir:; + if (isdir != NULL) + *isdir = 1; + return 0; } static void vfs_list_layergrps(pcb_board_t *pcb, pcb_vfs_list_cb cb, void *ctx)