Sexp changes between 1.5.3 and 1.6.0
ludo at gnu.org
Thu Jan 30 12:03:30 CET 2014
Werner Koch <wk at gnupg.org> skribis:
> On Sat, 21 Dec 2013 21:15, ludo at gnu.org said:
>> (BTW, as a Schemer, it took me a while to understand that car and nth do
>> not correspond to their traditional Lisp counterpart: the Lisp car and
>> nth return the given element, regardless of whether it is a list or an
> Well, that is a bug and it is related to your reproted bug 1594. I have
> now fixed it in master and will backport it to 1.6:
OK, thanks. The fix is not in 1.6.1, is it? (I didn’t see mention of
it in the announcement.)
> sexp: Fix broken gcry_sexp_nth.
> * src/sexp.c (_gcry_sexp_nth): Return a valid S-expression for a data
> (NODE): Remove unused typedef.
> (ST_HINT): Comment unused macro.
> * tests/t-sexp.c (bug_1594): New.
> (main): Run new test.
> Before 1.6.0 gcry_sexp_nth (list, 0) with a LIST of "(a (b 3:pqr) (c
> 3:456) (d 3:xyz))" returned the entire list. 1.6.0 instead returned
> NULL. However, this is also surprising and the expected value would
> be "(a)". This patch fixes this.
> Somewhat related to that gcry_sexp_nth returned a broken list if
> requesting index 1 of a list like "(n foo)". It returned just the
> "foo" but not as a list which is required by the S-expression specs.
> Due to this patch the returned value is now "(foo)".
Which spec are you referring to here?
<http://people.csail.mit.edu/rivest/Sexp.txt> doesn’t specify ‘car’,
‘cdr’, ‘nth’, etc.
More information about the Gcrypt-devel