summaryrefslogtreecommitdiff
path: root/sexp.c
diff options
context:
space:
mode:
authorNiels Möller <nisse@lysator.liu.se>2002-10-06 22:17:35 +0200
committerNiels Möller <nisse@lysator.liu.se>2002-10-06 22:17:35 +0200
commit18463581cf58c6ab79f1a18080da9459caaafab0 (patch)
tree183e2038816eee6f92246f11f51203ce3ea1f346 /sexp.c
parent4cef4bd0423db2a407182d2f9e534ab77fb81e9b (diff)
downloadnettle-18463581cf58c6ab79f1a18080da9459caaafab0.tar.gz
* sexp.c (sexp_iterator_enter_list): Call sexp_iterator_next to
get to the first element of the list. Updated callers. Rev: src/nettle/sexp.c:1.6 Rev: src/nettle/testsuite/sexp-test.c:1.6
Diffstat (limited to 'sexp.c')
-rw-r--r--sexp.c13
1 files changed, 5 insertions, 8 deletions
diff --git a/sexp.c b/sexp.c
index 112b694b..03d41224 100644
--- a/sexp.c
+++ b/sexp.c
@@ -172,7 +172,8 @@ sexp_iterator_enter_list(struct sexp_iterator *iterator)
iterator->level++;
iterator->type = SEXP_START;
- return 1;
+
+ return sexp_iterator_next(iterator);
}
/* Skips the rest of the current list */
@@ -201,7 +202,6 @@ sexp_iterator_check_type(struct sexp_iterator *iterator,
const uint8_t *type)
{
return (sexp_iterator_enter_list(iterator)
- && sexp_iterator_next(iterator)
&& iterator->type == SEXP_ATOM
&& !iterator->display
&& strlen(type) == iterator->atom_length
@@ -214,7 +214,6 @@ sexp_iterator_check_types(struct sexp_iterator *iterator,
const uint8_t **types)
{
if (sexp_iterator_enter_list(iterator)
- && sexp_iterator_next(iterator)
&& iterator->type == SEXP_ATOM
&& !iterator->display)
{
@@ -247,16 +246,12 @@ sexp_iterator_assoc(struct sexp_iterator *iterator,
for (;;)
{
- if (!sexp_iterator_next(iterator))
- return 0;
-
switch (iterator->type)
{
case SEXP_LIST:
/* FIXME: Use sexp_iterator_check_type? */
- if (! (sexp_iterator_enter_list(iterator)
- && sexp_iterator_next(iterator)))
+ if (!sexp_iterator_enter_list(iterator))
return 0;
if (iterator->type == SEXP_ATOM
@@ -299,5 +294,7 @@ sexp_iterator_assoc(struct sexp_iterator *iterator,
default:
abort();
}
+ if (!sexp_iterator_next(iterator))
+ return 0;
}
}