pkgsrc-WIP-changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

trader: avoid using strfmon(3) on NetBSD, use fallback code.



Module Name:	pkgsrc-wip
Committed By:	Frederic Cambus <fred%statdns.com@localhost>
Pushed By:	fcambus
Date:		Wed Feb 17 18:22:31 2021 +0100
Changeset:	ee3563a8a61c29804914012297355b896dd71836

Modified Files:
	trader/distinfo
	trader/patches/patch-src_utils.c

Log Message:
trader: avoid using strfmon(3) on NetBSD, use fallback code.

There are formatting issues when LANG is set to anything else than C.

To see a diff of this commit:
https://wip.pkgsrc.org/cgi-bin/gitweb.cgi?p=pkgsrc-wip.git;a=commitdiff;h=ee3563a8a61c29804914012297355b896dd71836

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

diffstat:
 trader/distinfo                  |  2 +-
 trader/patches/patch-src_utils.c | 21 ++++++++++++++++++---
 2 files changed, 19 insertions(+), 4 deletions(-)

diffs:
diff --git a/trader/distinfo b/trader/distinfo
index 15ac9dcb98..47bd167bc7 100644
--- a/trader/distinfo
+++ b/trader/distinfo
@@ -4,4 +4,4 @@ SHA1 (trader-7.16.tar.gz) = c98d61bf884f0ddd76b87e82552c0e864890cf12
 RMD160 (trader-7.16.tar.gz) = 460e358223a98c966ab109c9ddd1ed234de0407b
 SHA512 (trader-7.16.tar.gz) = a5565f26844c8aa98e18c0e90c75f2e0c4cafb43123b7d6be6228d278912ca76048d41d4d6711a31c9f6e22d5f62b9ba18105366fc4a1ea1cedeac1ba3fec794
 Size (trader-7.16.tar.gz) = 1259294 bytes
-SHA1 (patch-src_utils.c) = a093b98f155b9532e56b9158da2f6dd3d48c55ef
+SHA1 (patch-src_utils.c) = 80d5e22f7c01359ba8d881c9c2b1b27fc0882599
diff --git a/trader/patches/patch-src_utils.c b/trader/patches/patch-src_utils.c
index 0dcb7e1d08..8002392d8f 100644
--- a/trader/patches/patch-src_utils.c
+++ b/trader/patches/patch-src_utils.c
@@ -1,8 +1,11 @@
 $NetBSD$
 
-Do not use err_exit() to generate error messages when locale initialization
-fails as in this case curs_set() is called before initscr(), which causes
-trader to crash when built with NetBSD curses.
+- Do not use err_exit() to generate error messages when locale initialization
+  fails as in this case curs_set() is called before initscr(), which causes
+  trader to crash when built with NetBSD curses.
+
+- Avoid using strfmon(3) on NetBSD, there are formatting issues when LANG is
+  set to anything else than C.
 
 --- src/utils.c.orig	2021-01-19 05:42:38.000000000 +0000
 +++ src/utils.c
@@ -18,3 +21,15 @@ trader to crash when built with NetBSD curses.
      }
  
      // Use correct message catalogs for the locale
+@@ -682,7 +683,11 @@ ssize_t xwcsfmon (wchar_t *restrict buf,
+        produce "12345" instead of something like "-$123.45"!  The
+        following code overcomes these limitations by using snprintf(). */
+ 
++#if defined(__NetBSD__)
++    if (0) {
++#else
+     if (! is_posix_locale) {
++#endif
+ 	n = strfmon(s, BUFSIZE, format, val);
+     } else {
+ 	/* The current implementation assumes the monetary decimal point


Home | Main Index | Thread Index | Old Index