summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTimo Teräs <timo.teras@iki.fi>2018-11-02 15:33:49 +0200
committerTimo Teräs <timo.teras@iki.fi>2018-11-02 15:40:45 +0200
commit59271f8c1382efc6b52ac20c862ef7126317d0a8 (patch)
treebe0a8bea54c8e7875ca6a62d58fc5deb44b92953
parentf38d1f74af7a5ef0ccee2029be0d8036b9020f1a (diff)
downloadapk-tools-59271f8c1382efc6b52ac20c862ef7126317d0a8.tar.bz2
apk-tools-59271f8c1382efc6b52ac20c862ef7126317d0a8.tar.xz
print: don't print spurious newlines
-rw-r--r--src/print.c6
-rw-r--r--test/provides10.test3
-rw-r--r--test/provides11.test3
3 files changed, 5 insertions, 7 deletions
diff --git a/src/print.c b/src/print.c
index 63be863..b2bbca4 100644
--- a/src/print.c
+++ b/src/print.c
@@ -100,10 +100,10 @@ void apk_print_progress(size_t done, size_t total)
int apk_print_indented(struct apk_indent *i, apk_blob_t blob)
{
- if (i->x + blob.len + 1 >= apk_get_screen_width())
- i->x = printf("\n%*s" BLOB_FMT, i->indent, "", BLOB_PRINTF(blob)) - 1;
- else if (i->x <= i->indent)
+ if (i->x <= i->indent)
i->x += printf("%*s" BLOB_FMT, i->indent - i->x, "", BLOB_PRINTF(blob));
+ else if (i->x + blob.len + 1 >= apk_get_screen_width())
+ i->x = printf("\n%*s" BLOB_FMT, i->indent, "", BLOB_PRINTF(blob)) - 1;
else
i->x += printf(" " BLOB_FMT, BLOB_PRINTF(blob));
apk_progress_force = 1;
diff --git a/test/provides10.test b/test/provides10.test
index 4485543..ba8ab7b 100644
--- a/test/provides10.test
+++ b/test/provides10.test
@@ -7,5 +7,4 @@ ERROR: unsatisfiable constraints:
conflicted-provider (virtual):
provided by: conflicted-provider-a
conflicted-provider-b
- required by:
- conflicted-dep-0.1[conflicted-provider]
+ required by: conflicted-dep-0.1[conflicted-provider]
diff --git a/test/provides11.test b/test/provides11.test
index 47af3b2..e9f806e 100644
--- a/test/provides11.test
+++ b/test/provides11.test
@@ -7,5 +7,4 @@ ERROR: unsatisfiable constraints:
conflicted-provider (virtual):
provided by: conflicted-provider-a
conflicted-provider-b
- required by:
- conflicted-dep-0.1[conflicted-provider]
+ required by: conflicted-dep-0.1[conflicted-provider]