[Pkg-wmaker-commits] [wmifs] 08/118: wmifs: Display long interface names.

Doug Torrance dtorrance-guest at moszumanska.debian.org
Thu Aug 27 02:37:46 UTC 2015


This is an automated email from the git hooks/post-receive script.

dtorrance-guest pushed a commit to branch master
in repository wmifs.

commit 7fdebb75b2be37e0fddb279532d5f75cd1919ffb
Author: Doug Torrance <dtorrance at monmouthcollege.edu>
Date:   Wed Oct 22 16:34:36 2014 -0500

    wmifs: Display long interface names.
    
    Patch by Davi Leal <davileal at terra.es>.  First appeared in Debian package
    version 1.3b1-10.  Revised by Matyas Koszik <koszik at debijan.lonyay.edu.hu> for
    version 1.3b1-11.
    
    For more information, see:
    https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=103083
    https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=126501
---
 wmifs/wmifs.c | 19 ++++++++++++++++++-
 1 file changed, 18 insertions(+), 1 deletion(-)

diff --git a/wmifs/wmifs.c b/wmifs/wmifs.c
index 0cdb74e..972321c 100644
--- a/wmifs/wmifs.c
+++ b/wmifs/wmifs.c
@@ -74,6 +74,12 @@
 	----
 	Changes:
 	---
+	01/15/2002 (Matyas Koszik, koszik at debijan.lonyay.edu.hu)
+		* Patch that fixes segfaults on long interface names.
+	08/31/2001 (Davi Leal, davileal at terra.es)
+		* Patch that cuts long interface names, so they look
+		  good in wmifs. For example, "dummy0" gets displayed
+		  as "dumm0", "vmnet10" as "vmn10", etc.
 	06/16/2001 (Jorge García, Jorge.Garcia at uv.es)
 		* Added the LockMode, so wmifs doesn't swap to another
 		  interface if the one requested with "-i" isn't up.
@@ -540,7 +546,7 @@ void wmifs_routine(int argc, char **argv) {
 |* void DrawActiveIFS(char *)												   *|
 \*******************************************************************************/
 
-void DrawActiveIFS(char *name) {
+void DrawActiveIFS(char *real_name) {
 
 	/* Cijfers op: 0,65
 	   Letters op: 0,75
@@ -552,11 +558,22 @@ void DrawActiveIFS(char *name) {
 	int		i;
 	int		c;
 	int		k;
+	int		len;
+	char		name[256];
 
 
 	copyXPMArea(5, 84, 30, 10, 5, 5);
 
 
+	strcpy(name,real_name);
+	len = strlen(name);
+	if (len > 5)
+	{
+		for (i=len-5; i<len && !(name[i]>='0' && name[i]<='9'); i++)  ;
+		for (; i<=len; i++) /* '=' to get the '\0' character moved too \*/
+			name[i-(len-5)] = name[i];
+	}
+
 	k = 5;
 	for (i=0; name[i]; i++) {
 		if (i == strlen(name)-1 && strlen(name) <= 4 && name[strlen(name)-1] >= '0' && name[strlen(name)-1] <= '9') {

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-wmaker/wmifs.git



More information about the Pkg-wmaker-commits mailing list