This repository has been archived on 2024-03-20. You can view files and clone it, but you cannot make any changes to it's state, such as pushing and creating new issues, pull requests or comments.
gtkmeat/patches/gtkmeat.patch
2024-03-20 09:25:47 -05:00

78 lines
2.5 KiB
Diff

--- tmp/gtkmeat-0.5.5/gtkmeat.c Tue Jan 12 05:01:53 1999
+++ gtkmeat-0.5.5/gtkmeat.c Wed Jan 20 14:54:17 1999
@@ -102,6 +102,7 @@
gchar *article[2], *link;
FILE *fHnd;
gint i;
+ int eof_found;
fHnd = fopen(fname, "rb");
if (!fHnd) {
@@ -112,16 +113,21 @@
fclose(fHnd);
return FALSE;
}
+ g_free(line);
gtk_clist_clear(GTK_CLIST(list));
gtk_clist_freeze(GTK_CLIST(list));
link = NULL;
rewind(fHnd);
- while (line) {
+ for (i=0; i<2; i++)
+ article[i]=NULL;
+ for (eof_found=0;!eof_found;) {
gboolean bGotit = FALSE;
- if (line) /* should only happen once from above */
- g_free(line);
for (i = 0 ; i<num_fields; i++) {
line = app_getLine(fHnd);
+ /* we stuff line either into article, into link
+ or we free it immediatly. The stuff in article
+ will be freed down below, the link will be freed
+ with GtkDestroyNotify */
if (line) {
bGotit = TRUE;
switch (i) {
@@ -138,17 +144,23 @@
g_free(line);
break;
}
- }
+ } else {
+ eof_found=1;
+ break;
+ }
}
if (bGotit) {
- gint index;
- index = gtk_clist_append(GTK_CLIST(list), article);
- gtk_clist_set_row_data(GTK_CLIST(list), index, link);
- for (i=0; i<3; i++) {
- if (article[i])
- g_free(article[i]);
- }
+ gint index;
+ index = gtk_clist_append(GTK_CLIST(list), article);
+ gtk_clist_set_row_data_full(GTK_CLIST(list), index, link, &g_free);
}
+ for (i=0; i<2; i++) {
+ if (article[i])
+ {
+ g_free(article[i]);
+ article[i]=NULL;
+ }
+ }
}
fclose(fHnd);
gtk_clist_thaw(GTK_CLIST(list));
diff -ur tmp/gtkmeat-0.5.5/gtkmeatrc gtkmeat-0.5.5/gtkmeatrc
--- tmp/gtkmeat-0.5.5/gtkmeatrc Mon Jan 4 08:49:37 1999
+++ gtkmeat-0.5.5/gtkmeatrc Wed Jan 20 14:47:19 1999
@@ -23,6 +23,7 @@
# Curl command, %s is replaced by ~/recentnews.tmp
# Default: none
#curl-cmd "C:\Util\curl.exe -s -o %s http://files.freshmeat.net/freshmeat/recentnews.txt"
+#curl-cmd "/usr/local/bin/wget -q -O %s http://files.freshmeat.net/freshmeat/recentnews.txt"
curl-cmd "/usr/local/bin/curl -s -o %s http://files.freshmeat.net/freshmeat/recentnews.txt"
# If you'd like to run gtkmeat in "compact" mode (without