1 diff -Nru antiword-0.33/antiword.h antiword-0.33.new/antiword.h
2 --- antiword-0.33/antiword.h Thu Jun 20 09:16:22 2002
3 +++ antiword-0.33.new/antiword.h Sat Mar 22 21:29:50 2003
6 #define GLOBAL_ANTIWORD_DIR "/usr/share/antiword"
7 #define ANTIWORD_DIR ".antiword"
8 +#define ETC_DIR_ANTIWORD_DIR "antiword"
9 #define FONTNAMES_FILE "fontnames"
11 /* The name of the default mapping file */
12 diff -Nru antiword-0.33/options.c antiword-0.33.new/options.c
13 --- antiword-0.33/options.c Sat Jun 29 12:43:05 2002
14 +++ antiword-0.33.new/options.c Sat Mar 22 21:34:50 2003
16 PS_LEFT_MARGIN + PS_RIGHT_MARGIN));
17 DBG_DEC(tOptionsCurr.iParagraphBreak);
19 - /* Try the local version of the mapping file */
20 - szHome = szGetHomeDirectory();
21 - if (strlen(szHome) + strlen(szLeafname) <
22 - sizeof(szMappingFile) -
23 - sizeof(ANTIWORD_DIR) -
24 - 2 * sizeof(FILE_SEPARATOR)) {
25 - sprintf(szMappingFile,
26 - "%s" FILE_SEPARATOR ANTIWORD_DIR FILE_SEPARATOR "%s",
27 - szHome, szLeafname);
28 - DBG_MSG(szMappingFile);
29 - if (bReadCharacterMappingTable(szMappingFile)) {
33 - werr(0, "Local mappingfilename too long, ignored");
35 + szHome = getenv("ETC_DIR");
37 + if (strlen(szHome) + strlen(szLeafname) <
38 + sizeof(szMappingFile) -
39 + sizeof(ETC_DIR_ANTIWORD_DIR) -
40 + 2 * sizeof(FILE_SEPARATOR)) {
41 + sprintf(szMappingFile,
42 + "%s" FILE_SEPARATOR ETC_DIR_ANTIWORD_DIR FILE_SEPARATOR "%s",
43 + szHome, szLeafname);
44 + DBG_MSG(szMappingFile);
45 + if (bReadCharacterMappingTable(szMappingFile)) {
49 + werr(0, "Local mappingfilename too long, ignored");
53 + /* Try the local version of the mapping file */
54 + szHome = szGetHomeDirectory();
55 + if (strlen(szHome) + strlen(szLeafname) <
56 + sizeof(szMappingFile) -
57 + sizeof(ANTIWORD_DIR) -
58 + 2 * sizeof(FILE_SEPARATOR)) {
59 + sprintf(szMappingFile,
60 + "%s" FILE_SEPARATOR ANTIWORD_DIR FILE_SEPARATOR "%s",
61 + szHome, szLeafname);
62 + DBG_MSG(szMappingFile);
63 + if (bReadCharacterMappingTable(szMappingFile)) {
67 + werr(0, "Local mappingfilename too long, ignored");
71 /* Try the global version of the mapping file */
72 if (strlen(szLeafname) <
73 sizeof(szMappingFile) -
76 werr(0, "Global mappingfilename too long, ignored");
78 - werr(0, "I can't open your mapping file (%s)\n"
79 - "It is not in '%s" FILE_SEPARATOR ANTIWORD_DIR "' nor in '"
80 - GLOBAL_ANTIWORD_DIR "'.", szLeafname, szHome);
81 + if (getenv("ETC_DIR") != NULL)
82 + werr(0, "I can't open your mapping file (%s)\n"
83 + "It is not in '%s" FILE_SEPARATOR ETC_DIR_ANTIWORD_DIR "' nor in '"
84 + GLOBAL_ANTIWORD_DIR "'.", szLeafname, szHome);
86 + werr(0, "I can't open your mapping file (%s)\n"
87 + "It is not in '%s" FILE_SEPARATOR ANTIWORD_DIR "' nor in '"
88 + GLOBAL_ANTIWORD_DIR "'.", szLeafname, szHome);
91 } /* end of iReadOptions */