Skip to contentSkip to conversation

client: fix spurious newlines in station show

PATCH Superseded eNV25 3 participants 5 messages Nov 2, 2022

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

eNV25

author
#0 lore raw

PATCH 1/2 client: fix spurious newlines in station show

This change removes duplicated 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
author
#1 lore raw

PATCH 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 eNV25
Quoted 32 lines · On Wed, 2022-11-02 at 14:51 +0530, eNV25 wrote:

This change removes duplicated 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 +0 -0
index b070807b..1d958ef2 100644
@@ -217,15 +217,9 @@ static void display_station(const char
 *device_name,

                        47, network_get_name(station-

Quoted 1 line

connected_network));


                display_addresses(device_name);
-
-               /*
-                * If connected the diagnostic interface is presumably up so
-                * don't add the table footer just yet. -                */
-               return;

Quoted 8 lines

        }

-       display_table_footer();
+       /* The table footer is handled by cmd_show. */ }

 static void display_station_inline(const char *margin, const void *data)

LGTM, I noticed this happening but never spent the time to diagnose it. Thanks!

#3 lore raw
In reply to eNV25

Hi,

Quoted 7 lines · On 11/2/22 04:21, eNV25 wrote:

This change removes duplicated 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 7 lines
     $ iwctl
     [iwd]# station wlan0 show
---
  client/station.c | 8 +-------
  1 file changed, 1 insertion(+), 7 deletions(-)

Can I get a proper full name please? I can't take this into the repo otherwise.

Regards,
-Denis

author
#4 lore raw
Quoted 1 line · Denis Kenzior

Can I get a proper full name please? I can't take this into the repo otherwise.

My name is Neehar Vijay.

Do I need to send a v2 patch with the name?

Quoted 2 lines

Regards,
-Denis