freebsd-ports/japanese/tcsh/files/patch-ag
Masafumi Max NAKANE 3bdc138459 New port, japanese/tcsh:
An extended C-shell with many useful features with Japanese and color support.

PR:		5316
Submitted by:	Issei Suzuki <issei@mikage.t-cnet.or.jp>
1997-12-27 19:04:12 +00:00

46 lines
1.0 KiB
Plaintext

--- sh.func.c.orig Sun Dec 28 03:14:21 1997
+++ sh.func.c Sun Dec 28 03:15:00 1997
@@ -1273,6 +1273,9 @@
struct command *c;
{
Char *vp, *lp;
+#ifdef __FreeBSD__
+ static int catclosed = 0;
+#endif
USE(c);
if (*++v == 0) {
@@ -1312,9 +1315,19 @@
# ifdef LC_COLLATE
(void) setlocale(LC_COLLATE, "");
# endif
-# if defined(NLS_CATALOGS) && defined(LC_MESSAGES)
+# ifdef NLS_CATALOGS
+# ifdef LC_MESSAGES
(void) setlocale(LC_MESSAGES, "");
+# endif
+# ifdef __FreeBSD__
+ /* This code is to avoid bug. */
+ if (catclosed)
(void) catclose(catd);
+ else
+ catclosed = 1;
+# else
+ (void) catclose(catd);
+# endif /* __FreeBSD__ */
nlsinit();
# endif /* NLS_CATALOGS && LC_MESSAGES */
# ifdef LC_CTYPE
@@ -1487,8 +1500,10 @@
# ifdef LC_COLLATE
(void) setlocale(LC_COLLATE, "");
# endif
-# if defined(NLS_CATALOGS) && defined(LC_MESSAGES)
+# ifdef NLS_CATALOGS
+# ifdef LC_MESSAGES
(void) setlocale(LC_MESSAGES, "");
+# endif
(void) catclose(catd);
nlsinit();
# endif /* NLS_CATALOGS && LC_MESSAGES */