From b15f8f9a39465069f1eef4ef3a7cde5d03264540 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Niels=20M=C3=B6ller?= Date: Wed, 12 Dec 2001 21:07:59 +0100 Subject: [PATCH] (sexp_format): Add newline at the end of the "advanced" syntax representation. Changed all internal uses of sexp_format to use the method SEXP_FORMAT instead. Rev: src/sexp.c:1.42 --- src/sexp.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/sexp.c b/src/sexp.c index 67fde9a4..775523a3 100644 --- a/src/sexp.c +++ b/src/sexp.c @@ -389,7 +389,7 @@ do_format_sexp_vector(struct sexp *e, { CAST_SUBTYPE(sexp, car, LIST(v->elements)[0]); - return ssh_format("(%lfS)", sexp_format(car, style, indent)); + return ssh_format("(%lfS)", SEXP_FORMAT(car, style, indent)); } switch(style) @@ -411,7 +411,7 @@ do_format_sexp_vector(struct sexp *e, */ unsigned align_after = 0; - struct lsh_string *tag = sexp_format(car, style, indent); + struct lsh_string *tag = SEXP_FORMAT(car, style, indent); if (is_short(tag)) { @@ -427,7 +427,7 @@ do_format_sexp_vector(struct sexp *e, { CAST_SUBTYPE(sexp, o, LIST(v->elements)[i]); - elements[i] = sexp_format(o, style, indent); + elements[i] = SEXP_FORMAT(o, style, indent); size += elements[i]->length; } @@ -471,7 +471,7 @@ do_format_sexp_vector(struct sexp *e, { CAST_SUBTYPE(sexp, o, LIST(v->elements)[i]); - elements[i] = sexp_format(o, style, indent + 1); + elements[i] = SEXP_FORMAT(o, style, indent + 1); size += elements[i]->length; } @@ -583,10 +583,12 @@ sexp_format(struct sexp *e, int style, unsigned indent) case SEXP_TRANSPORT: return encode_base64(sexp_format(e, SEXP_CANONICAL, 0), "{}", 1, indent, 1); case SEXP_CANONICAL: + return SEXP_FORMAT(e, style, indent); + case SEXP_ADVANCED: case SEXP_INTERNATIONAL: - /* NOTE: Check for NULL here? I don't think so. */ - return SEXP_FORMAT(e, style, indent); + return ssh_format("%lfS\n", SEXP_FORMAT(e, style, indent)); + default: fatal("sexp_format: Unknown output style.\n"); } -- GitLab