summaryrefslogtreecommitdiff
path: root/japanese/oleo/files/patch-aa
blob: 7897302ab25a0b439f4750ae50854a3eb8efba7d (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
--- io-term.c.org	Thu Feb 12 16:59:47 1998
+++ io-term.c	Thu Feb 12 17:23:06 1998
@@ -23,6 +23,10 @@ the Free Software Foundation, 675 Mass A
 #else
 #include <locale.h>
 #endif
+/* Related to fpsetmask */
+#ifdef __FreeBSD__
+#include <floatingpoint.h>
+#endif
 
 #include "global.h"
 
@@ -1011,6 +1015,36 @@ main (argc, argv)
   volatile int init_fpc = 0;
   int command_line_file = 0;	/* was there one? */
 
+#ifdef EUC_JP
+  if ((getenv("DISPLAY") != NULL) &&
+      ((getenv("LANG") == NULL) || (strcmp(getenv("LANG"), "C") == 0))) {
+	fprintf(stderr, "==============================================\n");
+	fprintf(stderr, "      ja-oleo enviroment problem report       \n");
+	fprintf(stderr, "==============================================\n");
+	fprintf(stderr, " Sorry, ja-oleo has some locale and X problem.\n");
+	fprintf(stderr, "\n");
+	fprintf(stderr, " If you want to use as X client,\n");
+	fprintf(stderr, "   set enviroment variable LANG ja_JP.EUC\n");
+	fprintf(stderr, "   cf) under csh/tcsh\n");
+	fprintf(stderr, "     setenv LANG ja_JP.EUC\n");
+	fprintf(stderr, " If you want under LANG=C or LANG is not set:\n");
+	fprintf(stderr, "   you can't execute X client program as:\n");
+	fprintf(stderr, "   unset enviroment variable DISPLAY\n");
+	fprintf(stderr, "   cf) under csh/tcsh\n");
+	fprintf(stderr, "     unsetenv DISPLAY\n");
+	fprintf(stderr, "----------------------------------------------\n");
+	fprintf(stderr, " If you have a fix or comments, you are welcome\n");
+	fprintf(stderr, " to mail me <sanpei@yy.cs.keio.ac.jp>\n");
+	fprintf(stderr, "Thank you.\n");
+	exit(1);
+  }
+#endif /* EUC_JP */
+
+
+  /* oleo needs IEEE default behaviour under FreeBSD */
+#ifdef __FreeBSD__
+  fpsetmask(0);
+#endif
   argv_name = argv[0];
   __make_backups = 1;
 
@@ -1106,6 +1140,18 @@ main (argc, argv)
   FD_ZERO (&exception_pending_fd_set);
 
   if( setlocale(LC_ALL,"") == NULL ) {
+#ifdef EUC_JP
+      if (strcmp(getenv("LANG"), "ja_JP.EUC") == 0) {
+	fprintf(stderr, "----------------------------------------------\n");
+	fprintf(stderr, " If you run with ja_JP.EUC LOCALE, you need\n");
+	fprintf(stderr, " LC_COLLATE and LC_TIME file in\n");
+	fprintf(stderr, " /usr/share/locale/ja_JP.EUC directory.\n");
+	fprintf(stderr, " cd /usr/share/locale/ja_JP.EUC\n");
+	fprintf(stderr, " ln -s /usr/share/locale/lt_LN.ISO_8859-1/LC_COLLATE\n");
+	fprintf(stderr, " ln -s /usr/share/locale/en_US.ISO_8859-1/LC_TIME\n");
+	fprintf(stderr, "----------------------------------------------\n");
+      }
+#endif /* EUC_JP */
     panic("Can not set locale.");
   }
 #ifdef HAVE_X11_X_H