make-library returns existing library if name conflicts
This commit is contained in:
parent
fabe70aaf2
commit
906f2c8a93
|
@ -9,6 +9,10 @@ pic_make_library(pic_state *pic, pic_value name)
|
|||
{
|
||||
struct pic_lib *lib;
|
||||
|
||||
if ((lib = pic_find_library(pic, name)) != NULL) {
|
||||
return lib;
|
||||
}
|
||||
|
||||
lib = (struct pic_lib *)pic_obj_alloc(pic, sizeof(struct pic_lib), PIC_TT_LIB);
|
||||
lib->senv = pic_minimal_syntactic_env(pic);
|
||||
lib->exports = xh_new();
|
||||
|
|
Loading…
Reference in New Issue