]> git.lyx.org Git - lyx.git/blob - development/OS2/gnugettext.diff
fix typo that put too many include paths for most people
[lyx.git] / development / OS2 / gnugettext.diff
1 diff -ub intl.orig/bindtextdom.c intl/bindtextdom.c
2 --- intl.orig/bindtextdom.c     Thu Aug 28 09:18:18 1997
3 +++ intl/bindtextdom.c  Fri Apr 10 10:40:36 1998
4 @@ -94,15 +94,15 @@
5  
6    if (dirname == NULL)
7      /* The current binding has be to returned.  */
8 -    return binding == NULL ? (char *) _nl_default_dirname : binding->dirname;
9 +    return binding == NULL ? (char *) strdup(__XOS2RedirRoot(_nl_default_dirname)) : binding->dirname;
10  
11    if (binding != NULL)
12      {
13        /* The domain is already bound.  Replace the old binding.  */
14        char *new_dirname;
15  
16 -      if (strcmp (dirname, _nl_default_dirname) == 0)
17 -       new_dirname = (char *) _nl_default_dirname;
18 +      if (strcmp (dirname, __XOS2RedirRoot(_nl_default_dirname)) == 0)
19 +       new_dirname = (char *) strdup(__XOS2RedirRoot(_nl_default_dirname));
20        else
21         {
22           size_t len = strlen (dirname) + 1;
23 @@ -113,7 +113,7 @@
24           memcpy (new_dirname, dirname, len);
25         }
26  
27 -      if (strcmp (binding->dirname, _nl_default_dirname) != 0)
28 +      if (strcmp (binding->dirname, __XOS2RedirRoot(_nl_default_dirname)) != 0)
29          free (binding->dirname);
30  
31        binding->dirname = new_dirname;
32 @@ -134,8 +134,8 @@
33           return NULL;
34        memcpy (new_binding->domainname, domainname, len);
35  
36 -      if (strcmp (dirname, _nl_default_dirname) == 0)
37 -       new_binding->dirname = (char *) _nl_default_dirname;
38 +      if (strcmp (dirname, __XOS2RedirRoot(_nl_default_dirname)) == 0)
39 +       new_binding->dirname = (char *) strdup(__XOS2RedirRoot(_nl_default_dirname));
40        else
41         {
42           len = strlen (dirname) + 1;
43 diff -ub intl.orig/dcgettext.c intl/dcgettext.c
44 --- intl.orig/dcgettext.c       Thu Aug 28 09:18:20 1997
45 +++ intl/dcgettext.c    Fri Apr 10 10:40:34 1998
46 @@ -154,6 +154,7 @@
47  const char *_nl_current_default_domain = _nl_default_default_domain;
48  
49  /* Contains the default location of the message catalogs.  */
50 +
51  const char _nl_default_dirname[] = GNULOCALEDIR;
52  
53  /* List with bindings of specific domains created by bindtextdomain()
54 @@ -260,8 +261,12 @@
55      }
56  
57    if (binding == NULL)
58 -    dirname = (char *) _nl_default_dirname;
59 +    dirname = (char *) strdup(__XOS2RedirRoot(_nl_default_dirname));
60 +#ifdef __EMX__
61 +  else if (binding->dirname[0] == '/' || (isalpha(binding->dirname[0]) && binding->dirname[1] == ':'))
62 +#else
63    else if (binding->dirname[0] == '/')
64 +#endif
65      dirname = binding->dirname;
66    else
67      {
68 @@ -326,7 +331,7 @@
69    while (1)
70      {
71        /* Make CATEGORYVALUE point to the next element of the list.  */
72 -      while (categoryvalue[0] != '\0' && categoryvalue[0] == ':')
73 +      while (categoryvalue[0] != '\0' && categoryvalue[0] == PATH_SEPARATOR)
74         ++categoryvalue;
75        if (categoryvalue[0] == '\0')
76         {
77 @@ -340,7 +345,7 @@
78        else
79         {
80           char *cp = single_locale;
81 -         while (categoryvalue[0] != '\0' && categoryvalue[0] != ':')
82 +         while (categoryvalue[0] != '\0' && categoryvalue[0] != PATH_SEPARATOR)
83             *cp++ = *categoryvalue++;
84           *cp = '\0';
85         }
86 diff -ub intl.orig/gettext.h intl/gettext.h
87 --- intl.orig/gettext.h Thu Aug 28 09:18:20 1997
88 +++ intl/gettext.h      Wed Apr  8 15:47:08 1998
89 @@ -25,6 +25,12 @@
90  # include <limits.h>
91  #endif
92  
93 +#ifdef __EMX__
94 +#define PATH_SEPARATOR ';'
95 +#else
96 +#define PATH_SEPARATOR ':'
97 +#endif
98 +
99  /* @@ end of prolog @@ */
100  
101  /* The magic number of the GNU message catalog format.  */
102 diff -ub intl.orig/l10nflist.c intl/l10nflist.c
103 --- intl.orig/l10nflist.c       Thu Aug 28 09:18:22 1997
104 +++ intl/l10nflist.c    Thu Apr  9 00:03:58 1998
105 @@ -222,7 +222,11 @@
106  
107    /* Construct file name.  */
108    memcpy (abs_filename, dirlist, dirlist_len);
109 +#ifndef __EMX__
110    __argz_stringify (abs_filename, dirlist_len, ':');
111 +#else
112 +  __argz_stringify (abs_filename, dirlist_len, ';');
113 +#endif
114    cp = abs_filename + (dirlist_len - 1);
115    *cp++ = '/';
116    cp = stpcpy (cp, language);
117 diff -ub intl.orig/libgettext.h intl/libgettext.h
118 --- intl.orig/libgettext.h      Wed Sep 17 14:28:58 1997
119 +++ intl/libgettext.h   Wed Apr  8 15:47:08 1998
120 @@ -36,6 +36,13 @@
121  # include <locale.h>
122  #endif
123  
124 +#ifdef __EMX__
125 +#undef GNULOCALEDIR
126 +#define GNULOCALEDIR "/XFree86/lib/X11/locale"
127 +#include <X11/Xlocale.h>
128 +#else
129 +#define __XOS2RedirRoot(path) path
130 +#endif
131  
132  #ifdef __cplusplus
133  extern "C" {
134 diff -ub intl.orig/localealias.c intl/localealias.c
135 --- intl.orig/localealias.c     Thu Aug 28 09:18:22 1997
136 +++ intl/localealias.c  Wed Apr  8 15:47:08 1998
137 @@ -72,6 +72,11 @@
138  #include "gettext.h"
139  #include "gettextP.h"
140  
141 +#ifdef __EMX__
142 +#undef LOCALE_ALIAS_PATH
143 +#define LOCALE_ALIAS_PATH "/XFree86/lib/X11/locale"
144 +#endif
145 +
146  /* @@ end of prolog @@ */
147  
148  #ifdef _LIBC
149 @@ -170,11 +175,11 @@
150         {
151           const char *start;
152  
153 -         while (locale_alias_path[0] == ':')
154 +         while (locale_alias_path[0] == PATH_SEPARATOR)
155             ++locale_alias_path;
156           start = locale_alias_path;
157  
158 -         while (locale_alias_path[0] != '\0' && locale_alias_path[0] != ':')
159 +         while (locale_alias_path[0] != '\0' && locale_alias_path[0] != PATH_SEPARATOR)
160             ++locale_alias_path;
161  
162           if (start < locale_alias_path)
163 @@ -350,6 +355,9 @@
164       const struct alias_map *map1;
165       const struct alias_map *map2;
166  {
167 +#ifdef __EMX__
168 +#define strcasecmp stricmp
169 +#endif
170  #if defined _LIBC || defined HAVE_STRCASECMP
171    return strcasecmp (map1->alias, map2->alias);
172  #else