diff options
Diffstat (limited to 'guile_interface.scm.c')
-rw-r--r-- | guile_interface.scm.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/guile_interface.scm.c b/guile_interface.scm.c index fa4f2f5f..725d16e6 100644 --- a/guile_interface.scm.c +++ b/guile_interface.scm.c @@ -47,12 +47,17 @@ SCM_DEFINE (vcomponent_get_attribute, "vcomponent-get-attribute", 2, 0, 0, if (c == NULL) return SCM_BOOL_F; - // TODO returns the car of list if list is one long. SCM llist = SCM_EOL; FOR (LLIST, content_set, v, &c->val) { llist = scm_cons(scm_from_strbuf(&v->key), llist); } - return llist; + + /* returns the car of list if list is one long. */ + if (scm_to_int(scm_length(llist)) == 1) { + return SCM_CAR(llist); + } else { + return llist; + } } SCM_DEFINE (vcomponent_set_attr_x, "vcomponent-set-attribute!", 3, 0, 0, @@ -66,8 +71,6 @@ SCM_DEFINE (vcomponent_set_attr_x, "vcomponent-set-attribute!", 3, 0, 0, content_line* c = get_property (com, key); free(key); - // TODO if list is a value store it as is, else wrap it in a list - // of length one. scm_gc_unprotect_object(c->val.cur->value->key.scm); c->val.cur->value->key.scm = new_value; scm_gc_protect_object(c->val.cur->value->key.scm); |