Hello everybody.

Here is some kind of a [proposed] patch to fix charset(1) and 
dotlocking(2) issues in the tin-1.6.2-1

(1) tin's "local_charset" determination routine (which uses nl_langinfo)
fails due to limited locale implementation in cygwin 1.5.5-1 (at least
on my Russian-localised W'98 SE), making non-US-ASCII messages
unreadable.  This patch uses W32 GetACP() instead (just like
gettext-0.12.1 locale_charset() does). Also patches Makefile.in to get 
libkernel32 to linking.

*NB*: requires ./configure --disable-locale

(2) Yes, yes, everyone know this -- dotlocking on FAT [sigh]...

Maybe it will help someone...
So, here goes:

diff -urbN tin-1.6.2-1/src/config.c tin-1.6.2-1-patched/src/config.c
--- tin-1.6.2-1/src/config.c    2003-09-01 04:39:42.000000000 +0600
+++ tin-1.6.2-1-patched/src/config.c    2003-11-27 20:35:12.000000000 +0500
@@ -54,6 +54,11 @@
 #      include "tnntp.h"
 #endif /* TNNTP_H */
 
+#ifdef __CYGWIN__
+# define WIN32_LEAN_AND_MEAN
+# include <windows.h>
+#endif
+
 /*
  * local prototypes
  */
@@ -808,6 +813,9 @@
                                strcpy(tinrc.mm_local_charset, p);
                } else
 #endif /* !NO_LOCALE */
+#ifdef __CYGWIN__
+               sprintf (tinrc.mm_local_charset, "CP%u", GetACP ());
+#endif
                        if (!*tinrc.mm_local_charset)
 #ifndef CHARSET_CONVERSION
                                strcpy(tinrc.mm_local_charset, tinrc.mm_charset);
diff -urbN tin-1.6.2-1/src/Makefile.in tin-1.6.2-1-patched/src/Makefile.in
--- tin-1.6.2-1/src/Makefile.in 2003-08-10 19:27:36.000000000 +0600
+++ tin-1.6.2-1-patched/src/Makefile.in 2003-11-28 00:20:36.000000000 +0500
@@ -65,6 +65,9 @@
 INTL_LIBS      = @INTLLIBS@
 PCRE_LIBS      = @PCREDIR_LIBS@ @PCREDIR_MAKE@ -L../pcre -lpcre
 LIBS           = $(PCRE_LIBS) $(CANLIB) @LIBS@ @INN_NNTPLIB@ $(INTL_LIBS)
+ifeq (@host_os@,cygwin)
+LIBS           = $(PCRE_LIBS) $(CANLIB) @LIBS@ @INN_NNTPLIB@ $(INTL_LIBS) -lkernel32
+endif
 
 # Where do you want the binary & manual page installed?
 DESTDIR        = @DESTDIR@
diff -urbN tin-1.6.2-1/src/lock.c tin-1.6.2-1-patched/src/lock.c
--- tin-1.6.2-1/src/lock.c      2003-08-10 19:27:36.000000000 +0600
+++ tin-1.6.2-1-patched/src/lock.c      2003-11-28 21:35:02.000000000 +0500
@@ -235,7 +235,9 @@
        if (stat(lockfile, &statbuf)) {                         /* lockfile doesn't 
exist */
                if (!link(tempfile, lockfile)) {                        /* link 
succsessfull */
                        if (!stat(tempfile, &statbuf)) {        /* tempfile exist */
+#ifndef __CYGWIN__
                                if (statbuf.st_nlink == 2)                      /* 
link count ok */
+#endif
                                        rval = TRUE;
                        }
                }


-- 
Bye,
        Alex


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

Reply via email to