diff options
author | gahr <gahr@FreeBSD.org> | 2008-09-16 21:17:55 +0800 |
---|---|---|
committer | gahr <gahr@FreeBSD.org> | 2008-09-16 21:17:55 +0800 |
commit | a1ed70e763c1dc39ce92e82693d2cdc116db917b (patch) | |
tree | 939313fd6ee14773c4d5fdd6668fcb2aad52d34f /net/jags | |
parent | 391e033d41a1c96a425dab7ef05414577e7fe173 (diff) | |
download | freebsd-ports-gnome-a1ed70e763c1dc39ce92e82693d2cdc116db917b.tar.gz freebsd-ports-gnome-a1ed70e763c1dc39ce92e82693d2cdc116db917b.tar.zst freebsd-ports-gnome-a1ed70e763c1dc39ce92e82693d2cdc116db917b.zip |
- Teach a few NULL pointers not to segfault at runtime
- Bump PORTREVISION
Approved by: portmgr (pav)
Diffstat (limited to 'net/jags')
-rw-r--r-- | net/jags/Makefile | 1 | ||||
-rw-r--r-- | net/jags/files/patch-src_mainwindow.cpp | 56 |
2 files changed, 57 insertions, 0 deletions
diff --git a/net/jags/Makefile b/net/jags/Makefile index c45e133ffac2..048ae8eceadc 100644 --- a/net/jags/Makefile +++ b/net/jags/Makefile @@ -7,6 +7,7 @@ PORTNAME= jags PORTVERSION= 0.22.1 +PORTREVISION= 1 CATEGORIES= net MASTER_SITES= SF diff --git a/net/jags/files/patch-src_mainwindow.cpp b/net/jags/files/patch-src_mainwindow.cpp new file mode 100644 index 000000000000..08442e2c35e8 --- /dev/null +++ b/net/jags/files/patch-src_mainwindow.cpp @@ -0,0 +1,56 @@ +--- src/mainwindow.cpp.orig 2008-09-16 14:27:01.000000000 +0200 ++++ src/mainwindow.cpp 2008-09-16 14:58:48.000000000 +0200 +@@ -299,6 +299,8 @@ + gchar *workgroup = NULL, *command = NULL, *comment = NULL, *comment2 = NULL; + gint h; + ++ if(!parent_tree) ++ return FALSE; + + if (GTK_TREE(parent_tree)->children) + gtk_tree_remove_items(GTK_TREE(parent_tree), +@@ -349,11 +351,15 @@ + + while (glist->next) { + //---get the string width in pixels---------------------------------- +- h = gdk_string_width(style->font, "DDDDDDDDDDDDDDDDD") - +- gdk_string_width(style->font, (gchar *)glist->next->data); +- h /= gdk_string_width(style->font, "D"); ++ if(style) { ++ h = gdk_string_width(style->font, "DDDDDDDDDDDDDDDDD") - ++ gdk_string_width(style->font, (gchar *)glist->next->data); ++ h /= gdk_string_width(style->font, "D"); ++ comment = g_strnfill(h, 0x20); ++ } else { ++ comment = NULL; ++ } + +- comment = g_strnfill(h, 0x20); + comment2 = g_strescape(g_strconcat((gchar *)glist->next->data, comment, + (gchar *)glist2->next->data, NULL)); + g_free(comment); +@@ -414,6 +420,9 @@ + gchar *ShareName = new gchar[100]; + gint h; + ++ if(!parent_tree) ++ return FALSE; ++ + /* Get the text on this treeitem into "workgroup" */ + item = GTK_TREE(parent_tree)->tree_owner; + server = g_strdup_printf("%s", gtk_tree_item_get_text(item)); +@@ -478,9 +487,11 @@ + while (glist->next) { + if (g_strncasecmp((gchar *)glist->next->data, "Error", 5)) { + g_strdup_printf(ShareName,"%s", (gchar *)glist->next->data); +- h = gdk_string_width(style->font, "DDDDDDDDDDDDDDDDDDD") - +- gdk_string_width(style->font, (gchar *)glist->next->data); +- h /= gdk_string_width(style->font, " "); ++ if (style) { ++ h = gdk_string_width(style->font, "DDDDDDDDDDDDDDDDDDD") - ++ gdk_string_width(style->font, (gchar *)glist->next->data); ++ h /= gdk_string_width(style->font, " "); ++ } + comment = g_strnfill(h, 0x20); + comment2 = g_strconcat((gchar *)glist->next->data, comment, + (gchar *)glist3->next->data, NULL); |