random patches

This commit is contained in:
tengel 2024-03-20 09:25:47 -05:00
parent e3e6450c9c
commit 5d22f01466
3 changed files with 210 additions and 0 deletions

78
patches/gtkmeat.patch Normal file
View file

@ -0,0 +1,78 @@
--- 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

37
patches/gtkmeatrc.new Normal file
View file

@ -0,0 +1,37 @@
# Configuration file for gtkMeat
#
# System Wide:
# /etc/gtkmeatrc
# <windowsdir>\gtkmeatrc
#
# Per user:
# <HOME>/.gtkmeatrc
# <HOME>\_gtkmeatrc
# Number of seconds before a refresh is performed...
# Default: 1800
refresh-timeout 1800
# Netscape command, %s is replaced by the URL
# Default: none
#browser-cmd "D:\Netscape\Program\netscape.exe %s"
# Under *nix, we need two commands for netscape - one if the browser
# isn't running already, and one if it is
new-browser-cmd "/usr/local/bin/netscape %s &"
browser-cmd "/usr/local/bin/netscape -remote 'openURL(%s, new_window)' &"
# 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/curl -s -o %s http://files.freshmeat.net/freshmeat/recentnews.txt"
# If you'd like to run gtkmeat in "compact" mode (without
# the buttons on the bottom & the column titles, and
# launching an article upon a click on its row) set this
# variable to ON. Default: OFF
compact-mode OFF
# Number of fields in recentnews.txt. There are 3 fields per
# record as of 01/03/99.
# Default: 3
num-fields 3

View file

@ -0,0 +1,95 @@
*** gtkmeat-0.5.5/gtkmeat.c Tue Jan 12 04:01:53 1999
--- gtkmeat-0.5.5b/gtkmeat.c Wed Jan 13 09:55:53 1999
***************
*** 99,105 ****
static
BOOL app_loadFile(GtkWidget *list, const gchar *fname) {
gchar *line;
! gchar *article[2], *link;
FILE *fHnd;
gint i;
--- 99,105 ----
static
BOOL app_loadFile(GtkWidget *list, const gchar *fname) {
gchar *line;
! gchar *article[3], *link; /* Changed 2 ==> 3 */
FILE *fHnd;
gint i;
***************
*** 116,125 ****
gtk_clist_freeze(GTK_CLIST(list));
link = NULL;
rewind(fHnd);
- while (line) {
- 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);
if (line) {
--- 116,125 ----
gtk_clist_freeze(GTK_CLIST(list));
link = NULL;
rewind(fHnd);
if (line) /* should only happen once from above */
g_free(line);
+ while (line) {
+ gboolean bGotit = FALSE;
for (i = 0 ; i<num_fields; i++) {
line = app_getLine(fHnd);
if (line) {
***************
*** 143,150 ****
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]);
}
--- 143,151 ----
if (bGotit) {
gint index;
index = gtk_clist_append(GTK_CLIST(list), article);
+ /* article[ 2 ] = link ; /* Added */
gtk_clist_set_row_data(GTK_CLIST(list), index, link);
! for (i=0; i<2; i++) { /* Changed lim 3 ==> 2 */
if (article[i])
g_free(article[i]);
}
***************
*** 160,165 ****
--- 161,167 ----
static
BOOL app_startApp(const gchar *cmd, BOOL bWait, WORD wShowState) {
#ifndef WIN32
+ #if 0
char **args, *work, *twrk;
int cnt, len, scnt, pid, sta;
***************
*** 209,214 ****
--- 211,220 ----
}
}
return TRUE;
+ #else
+ int rc = system( cmd );
+ return ( (rc == 0 ) ? TRUE : FALSE ) ;
+ #endif
#else /* Win32 */
STARTUPINFO startupinfo;
PROCESS_INFORMATION processinfo;
***************
*** 347,352 ****
--- 353,359 ----
} else {
sprintf(cmd, browser_cmd, url);
}
+ g_free( fname ); /* Added */
#else
sprintf(cmd, browser_cmd, url);
#endif /* WIN32 */