2 changed files with 112 additions and 24 deletions
@ -0,0 +1,110 @@ |
|||||||
|
Index: antiword.h
|
||||||
|
--- antiword.h.orig 2004-09-30 20:55:56.000000000 +0200
|
||||||
|
+++ antiword.h 2005-02-17 20:04:40.364083736 +0100
|
||||||
|
@@ -194,7 +194,7 @@
|
||||||
|
#define FONTNAMES_FILE "fontname.txt"
|
||||||
|
#elif defined(__amigaos)
|
||||||
|
#define GLOBAL_ANTIWORD_DIR "SYS:.antiword"
|
||||||
|
-#define ANTIWORD_DIR ".antiword"
|
||||||
|
+#define ANTIWORD_DIR "antiword"
|
||||||
|
#define FONTNAMES_FILE "fontnames"
|
||||||
|
#elif defined(N_PLAT_NLM)
|
||||||
|
#define GLOBAL_ANTIWORD_DIR "SYS:/antiword"
|
||||||
|
@@ -218,7 +218,7 @@
|
||||||
|
#define FONTNAMES_FILE "fontnames"
|
||||||
|
#else /* All others */
|
||||||
|
#define GLOBAL_ANTIWORD_DIR "/usr/share/antiword"
|
||||||
|
-#define ANTIWORD_DIR ".antiword"
|
||||||
|
+#define ANTIWORD_DIR "antiword"
|
||||||
|
#define FONTNAMES_FILE "fontnames"
|
||||||
|
#endif /* __dos */
|
||||||
|
/* The names of grouped mapping files */
|
||||||
|
Index: chartrans.c
|
||||||
|
--- chartrans.c.orig 2004-09-13 13:17:37.000000000 +0200
|
||||||
|
+++ chartrans.c 2005-02-17 20:04:40.364604120 +0100
|
||||||
|
@@ -6,10 +6,15 @@
|
||||||
|
* Translate Word characters to local representation
|
||||||
|
*/
|
||||||
|
|
||||||
|
+#if defined(__FreeBSD__)
|
||||||
|
+#include <osreldate.h>
|
||||||
|
+#endif
|
||||||
|
+
|
||||||
|
#include <stdlib.h>
|
||||||
|
#include <string.h>
|
||||||
|
#include <ctype.h>
|
||||||
|
-#if defined(__STDC_ISO_10646__)
|
||||||
|
+#if defined(__STDC_ISO_10646__) || defined(__FreeBSD__) || defined(__NetBSD__)
|
||||||
|
+#include <wchar.h>
|
||||||
|
#include <wctype.h>
|
||||||
|
#endif /* __STDC_ISO_10646__ */
|
||||||
|
#include "antiword.h"
|
||||||
|
@@ -700,7 +705,8 @@
|
||||||
|
*/
|
||||||
|
return ulChar & ~0x20;
|
||||||
|
}
|
||||||
|
-#if defined(__STDC_ISO_10646__)
|
||||||
|
+#if defined(__STDC_ISO_10646__) || (defined(__FreeBSD__) && __FreeBSD_version >= 500000) || defined(__NetBSD__)
|
||||||
|
+#include <wchar.h>
|
||||||
|
/*
|
||||||
|
* If this is ISO C99 and all locales have wchar_t = ISO 10646
|
||||||
|
* (e.g., glibc 2.2 or newer), then use standard function
|
||||||
|
Index: fonts_u.c
|
||||||
|
--- fonts_u.c.orig 2004-09-07 17:16:42.000000000 +0200
|
||||||
|
+++ fonts_u.c 2005-02-17 20:04:40.364855447 +0100
|
||||||
|
@@ -56,7 +56,6 @@
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Try the local version of the fontnames file */
|
||||||
|
- szHome = szGetHomeDirectory();
|
||||||
|
if (strlen(szHome) +
|
||||||
|
sizeof(FILE_SEPARATOR ANTIWORD_DIR FILE_SEPARATOR FONTNAMES_FILE) >=
|
||||||
|
sizeof(szLocalFile)) {
|
||||||
|
Index: main_u.c
|
||||||
|
--- main_u.c.orig 2004-10-14 18:49:18.000000000 +0200
|
||||||
|
+++ main_u.c 2005-02-17 20:05:46.016037658 +0100
|
||||||
|
@@ -29,7 +29,8 @@
|
||||||
|
#include <fcntl.h>
|
||||||
|
#include <io.h>
|
||||||
|
#endif /* __dos */
|
||||||
|
-#if defined(__STDC_ISO_10646__)
|
||||||
|
+#if defined(__STDC_ISO_10646__) || defined(__FreeBSD__) || defined(__NetBSD__)
|
||||||
|
+#include <wchar.h>
|
||||||
|
#include <locale.h>
|
||||||
|
#endif /* __STDC_ISO_10646__ */
|
||||||
|
#if defined(N_PLAT_NLM)
|
||||||
|
@@ -245,7 +246,8 @@
|
||||||
|
|
||||||
|
#if !defined(__dos)
|
||||||
|
if (is_locale_utf8()) {
|
||||||
|
-#if defined(__STDC_ISO_10646__)
|
||||||
|
+#if defined(__STDC_ISO_10646__) || defined(__FreeBSD__) || defined(__NetBSD__)
|
||||||
|
+#include <wchar.h>
|
||||||
|
/*
|
||||||
|
* If the user wants UTF-8 and the envirionment variables
|
||||||
|
* support UTF-8, than set the locale accordingly
|
||||||
|
@@ -261,11 +263,13 @@
|
||||||
|
}
|
||||||
|
#endif /* __STDC_ISO_10646__ */
|
||||||
|
} else {
|
||||||
|
+#ifdef LC_CTYPE
|
||||||
|
if (setlocale(LC_CTYPE, "") == NULL) {
|
||||||
|
werr(0, "Can't set the locale! Will use defaults");
|
||||||
|
(void)setlocale(LC_CTYPE, "C");
|
||||||
|
}
|
||||||
|
DBG_MSG("The locale has been set");
|
||||||
|
+#endif
|
||||||
|
}
|
||||||
|
#endif /* !__dos */
|
||||||
|
|
||||||
|
Index: options.c
|
||||||
|
--- options.c.orig 2004-10-08 20:54:36.000000000 +0200
|
||||||
|
+++ options.c 2005-02-17 20:04:40.365514131 +0100
|
||||||
|
@@ -216,7 +216,6 @@
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Try the local version of the mapping file */
|
||||||
|
- szHome = szGetHomeDirectory();
|
||||||
|
if (strlen(szHome) + tFilenameLen <
|
||||||
|
sizeof(szMappingFile) -
|
||||||
|
sizeof(ANTIWORD_DIR) -
|
Loading…
Reference in new issue