Skip to contentSkip to conversation

client: fix extra newlines in station show

PATCH In review Neehar Vijay 2 participants 3 messages Nov 2, 2022

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/2 client: fix extra newlines in station show

This change removes duplicate calls to display_table_footer(), in station show.

Before this change, the bug caused an extra newline to be output every time the table updated. This only occurred when the network was disconnected.

    $ iwctl
    [iwd]# station wlan0 show
---
 client/station.c | 8 +-------
 1 file changed, 1 insertion(+), 7 deletions(-)
client/station.c +1 -7
index b070807b..1d958ef2 100644
@@ -217,15 +217,9 @@ static void display_station(const char *device_name,
 			47, network_get_name(station->connected_network));
 
 		display_addresses(device_name);
-
-		/*
-		 * If connected the diagnostic interface is presumably up so
-		 * don't add the table footer just yet.
-		 */
-		return;
 	}
 
-	display_table_footer();
+	/* The table footer is handled by cmd_show. */
 }
 
 static void display_station_inline(const char *margin, const void *data)
Signature · 1 line
2.38.1
#1 lore raw

PATCH v2 2/2 gitignore: add .cache

This directory is used by clangd.

---
 .gitignore | 1 +
 1 file changed, 1 insertion(+)
.gitignore +1 -0
index cde22889..61b3638d 100644
@@ -4,6 +4,7 @@
 .libs
 .deps
 .dirstamp
+.cache
 tags
 cscope.*
 Makefile
Signature · 1 line
2.38.1
#2 lore raw
In reply to Neehar Vijay

Hi Neehar,

Quoted 7 lines · Neehar Vijay

This change removes duplicate calls to display_table_footer(), in station show.

Before this change, the bug caused an extra newline to be output every time the table updated. This only occurred when the network was disconnected.

Quoted 6 lines
     $ iwctl
     [iwd]# station wlan0 show
---
  client/station.c | 8 +-------
  1 file changed, 1 insertion(+), 7 deletions(-)

Both applied, thanks.

Regards,
-Denis