Path: blob/main/x11/bbrun/files/patch-bbrun.c
21793 views
--- bbrun.c.orig 2004-02-13 01:24:59.000000000 +01001+++ bbrun.c 2012-06-01 20:42:51.000000000 +02002@@ -3,7 +3,11 @@3#include <string.h>4#include <getopt.h>5#include <unistd.h>6+#ifdef __FreeBSD__7+#include <sys/types.h>8+#else9#include <linux/types.h>10+#endif11#include <X11/xpm.h>12#include <gtk/gtk.h>13#include <gdk/gdkkeysyms.h>14@@ -20,7 +24,7 @@15#define ADVANCED_WINDOW_ROWS 316#define ADVANCED_WINDOW_COLS 101718-#define u32 __u3219+#define u32 uintptr_t20#define __DEBUG__ 021#define VERSION "1.6"2223@@ -38,8 +42,8 @@ char historyFilename[MAXPATHLEN + 1];2425// TOC = Table Of Contents, it is a dynamically allocated array of pointers to dynamically26// allocated history items.27-u32 *histTOC; // Always keep track of the beginning, this one is NEVER incremented.28-u32 *histTOC2; // We increment this one for each item29+u32 *histTOC = NULL; // Always keep track of the beginning, this one is NEVER incremented.30+u32 *histTOC2 = NULL; // We increment this one for each item3132void parseArguments(int, char **);33void execDialogInformation();34@@ -197,7 +201,7 @@ void readHistory(void) {3536item = malloc(strlen(buf));37strncpy(item, buf, strlen(buf));38- item[strlen(buf)- 1] = 0x0; // Remove the newline char39+ item[strlen(buf)- 1] = '\0'; // Remove the newline char4041*histTOC2 = (u32) item;42} else {43@@ -322,7 +326,7 @@ void writeHistory()44// Event handler for Ok and Cancel buttons45void callback (GtkWidget * widget, gpointer data)46{47- if ((char *) data == "ok")48+ if ((strcmp(data, "ok")) == 0)49execDialogInformation();5051gtk_main_quit();525354