antiright-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Antiright-devel] antiright/gtkshell add_options.c updated_label.c


From: Jeffrey Bedard
Subject: [Antiright-devel] antiright/gtkshell add_options.c updated_label.c
Date: Wed, 07 Feb 2007 16:05:58 +0000

CVSROOT:        /sources/antiright
Module name:    antiright
Changes by:     Jeffrey Bedard <jefbed> 07/02/07 16:05:58

Modified files:
        gtkshell       : add_options.c updated_label.c 

Log message:
        A check for empty output was added to updated_label.c to prevent a gtk 
warning.  

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/antiright/gtkshell/add_options.c?cvsroot=antiright&r1=1.1&r2=1.2
http://cvs.savannah.gnu.org/viewcvs/antiright/gtkshell/updated_label.c?cvsroot=antiright&r1=1.1&r2=1.2

Patches:
Index: add_options.c
===================================================================
RCS file: /sources/antiright/antiright/gtkshell/add_options.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -b -r1.1 -r1.2

Index: updated_label.c
===================================================================
RCS file: /sources/antiright/antiright/gtkshell/updated_label.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -b -r1.1 -r1.2
--- updated_label.c     1 Feb 2007 20:45:49 -0000       1.1
+++ updated_label.c     7 Feb 2007 16:05:58 -0000       1.2
@@ -32,6 +32,15 @@
 #endif
        
        results=antiright_pipe_read(command);
+
+    /* This ensures that the result string is not empty, avoiding certain 
formatting problems.  */
+    /* Otherwise, a GTK warning is produced.  */
+    if(!strncmp(results, "", 1))
+    {
+        free(results);
+        asprintf(&results, " ");
+    }
+
        gsh_set_label((GtkWidget*)widget, results);
        free(results);
 }




reply via email to

[Prev in Thread] Current Thread [Next in Thread]