Patch by Davi Leal <davil...@terra.es>.  First appeared in Debian package
version 1.3b1-10.  Revised by Matyas Koszik <kos...@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/wmifs.c | 19 ++++++++++++++++++-
 1 file changed, 18 insertions(+), 1 deletion(-)

diff --git a/wmifs/wmifs/wmifs.c b/wmifs/wmifs/wmifs.c
index 0cdb74e..972321c 100644
--- a/wmifs/wmifs/wmifs.c
+++ b/wmifs/wmifs/wmifs.c
@@ -74,6 +74,12 @@
        ----
        Changes:
        ---
+       01/15/2002 (Matyas Koszik, kos...@debijan.lonyay.edu.hu)
+               * Patch that fixes segfaults on long interface names.
+       08/31/2001 (Davi Leal, davil...@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.gar...@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') {
-- 
1.9.1


-- 
To unsubscribe, send mail to wmaker-dev-unsubscr...@lists.windowmaker.org.

Reply via email to