]> git.ipfire.org Git - thirdparty/knot-dns.git/commitdiff
kdig: remove boring newlines between retries
authorDaniel Salzman <daniel.salzman@nic.cz>
Wed, 2 Jan 2019 11:10:24 +0000 (12:10 +0100)
committerDaniel Salzman <daniel.salzman@nic.cz>
Wed, 2 Jan 2019 12:27:31 +0000 (13:27 +0100)
src/utils/kdig/kdig_exec.c

index 0cdffe265e4c0d1868db6678d6653fbc177b2a5c..2e4c066bd6ff388f1004b3192e006677d0ced088 100644 (file)
@@ -827,7 +827,7 @@ static void process_query(const query_t *query)
                                // If error try next resolved address.
                                if (ret != 0) {
                                        net.srv = (net.srv)->ai_next;
-                                       if (net.srv != NULL) {
+                                       if (net.srv != NULL && query->style.show_query) {
                                                printf("\n");
                                        }
 
@@ -846,10 +846,13 @@ static void process_query(const query_t *query)
                        }
 
                        if (i < query->retries) {
-                               printf("\n");
                                DBG("retrying server %s@%s(%s)\n",
                                    remote->name, remote->service,
                                    get_sockname(socktype));
+
+                               if (query->style.show_query) {
+                                       printf("\n");
+                               }
                        }
 
                        net_clean(&net);
@@ -859,7 +862,7 @@ static void process_query(const query_t *query)
                     remote->name, remote->service, get_sockname(socktype));
 
                // If not last server, print separation.
-               if (server->next->next) {
+               if (server->next->next && query->style.show_query) {
                        printf("\n");
                }
        }