pkgsrc/x11/xview-lib/patches/patch-eg
abs c9c8f97e88 - Add PKG_DESTDIR_SUPPORT
- Depend on the latest version of xview-config
- Mark as LICENSE sun-openlook-license
- Bump pkgrevision
2009-12-10 20:35:56 +00:00

65 lines
1.6 KiB
Text

$NetBSD: patch-eg,v 1.2 2009/12/10 20:35:58 abs Exp $
--- lib/libxview/textsw/txt_once.c.orig 1993-06-29 05:17:48.000000000 +0000
+++ lib/libxview/textsw/txt_once.c
@@ -18,6 +18,7 @@ static char sccsid[] = "@(#)txt_once.c 2
#include <xview/textsw.h>
#include <xview_private/txt_impl.h>
#include <fcntl.h>
+#include <limits.h>
#include <signal.h>
#include <pixrect/pr_util.h>
@@ -548,13 +549,21 @@ textsw_init_internal(folio, status, defa
Es_handle ps_esh;
Ei_handle plain_text_eih;
char *name = 0;
+#ifdef NAME_MAX
+ CHAR scratch_name[NAME_MAX];
+#else
CHAR scratch_name[MAXNAMLEN];
+#endif
Es_status es_status;
Frame frame;
Xv_Notice text_notice;
extern void textsw_split_init_proc();
#ifdef OW_I18N
+#ifdef NAME_MAX
+ CHAR name_wc[NAME_MAX];
+#else
CHAR name_wc[MAXNAMLEN];
+#endif
#ifdef FULL_R5
XVaNestedList va_nested_list;
#endif /* FULL_R5 */
@@ -642,18 +651,30 @@ textsw_init_internal(folio, status, defa
name = (char *) defaults[1];
#ifdef OW_I18N
if (name)
+#ifdef NAME_MAX
+ (void) mbstowcs(name_wc, name, NAME_MAX);
+#else
(void) mbstowcs(name_wc, name, MAXNAMLEN);
#endif
+#endif
}
#ifdef OW_I18N
defaults = attr_find(attrs, TEXTSW_FILE_WCS);
if (*defaults) {
+#ifdef NAME_MAX
+ char name_mb[NAME_MAX];
+#else
char name_mb[MAXNAMLEN];
+#endif
ATTR_CONSUME(*defaults);
STRCPY(name_wc, (CHAR *) defaults[1]);
+#ifdef NAME_MAX
+ (void) wcstombs(name_mb, name_wc, NAME_MAX);
+#else
(void) wcstombs(name_mb, name_wc, MAXNAMLEN);
+#endif
name = name_mb;
}
if (name_wc[0] != NULL) { /* } for match */