pkgsrc/graphics/xbmbrowser/patches/patch-ab
joerg 1e837f5f6e Prefer the POSIX NAME_MAX over MAXNAMLEN when available. Try a bit
harder to avoid stack overflows, bump revision for that.
2006-06-26 16:11:43 +00:00

53 lines
2.4 KiB
Text

$NetBSD: patch-ab,v 1.1 2006/06/26 16:11:43 joerg Exp $
--- xbmbrowser.h.orig 2006-06-26 15:27:35.000000000 +0000
+++ xbmbrowser.h
@@ -27,6 +27,7 @@
#include <stdio.h> /* C library includes */
#include <dirent.h> /* Filename length (and dir functions) */
#include <assert.h> /* debugging assertions */
+#include <limits.h>
#include <X11/Xaw/Form.h> /* widget includes */
#include <X11/Xaw/Box.h>
@@ -82,8 +83,13 @@ enum FileType {
/* item structure */
typedef struct _item {
struct _item *next; /* next item */
+#ifdef NAME_MAX
+ char fname[NAME_MAX]; /* This files name in current dir */
+ char info[NAME_MAX+40]; /* information to display about icon */
+#else
char fname[MAXNAMLEN]; /* This files name in current dir */
char info[MAXNAMLEN+40]; /* information to display about icon */
+#endif
time_t mtime; /* last modification time */
enum FileType type; /* file type */
Boolean visible; /* visible to user? */
@@ -167,6 +173,18 @@ ext Widget menu_bitmap, menu_pixmap;
ext Widget menu_directory, menu_other;
/* substitution strings for function argument macro substitions */
+#ifdef NAME_MAX
+ext char dir_name[NAME_MAX]; /* %d the current directory */
+ext char file_name[NAME_MAX]; /* %f current filename */
+ext char base_name[NAME_MAX]; /* %b basename for current file */
+ext char suffix[NAME_MAX]; /* %s suffix of current file */
+ext char input[NAME_MAX]; /* %i input string from user */
+ext char home_dir[NAME_MAX]; /* %h the users home directory */
+ext char init_dir[NAME_MAX]; /* %D initial startup directory */
+
+/* Information strings for display in application label */
+ext char label_info[NAME_MAX]; /* label to show when outside bitmap */
+#else
ext char dir_name[MAXNAMLEN]; /* %d the current directory */
ext char file_name[MAXNAMLEN]; /* %f current filename */
ext char base_name[MAXNAMLEN]; /* %b basename for current file */
@@ -177,6 +195,7 @@ ext char init_dir[MAXNAMLEN]; /*
/* Information strings for display in application label */
ext char label_info[MAXNAMLEN]; /* label to show when outside bitmap */
+#endif
ext Item *current_item; /* which item the user is pointing to */
/* some external variables */