ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/svn/ircd-hybrid/trunk/src/numeric.c
(Generate patch)

Comparing:
ircd-hybrid-7.2/src/numeric.c (file contents), Revision 34 by lusky, Sun Oct 2 21:05:51 2005 UTC vs.
ircd-hybrid/trunk/src/numeric.c (file contents), Revision 1646 by michael, Wed Nov 7 21:02:43 2012 UTC

# Line 26 | Line 26
26  
27   #include "numeric.h"
28   #include "irc_string.h"
29 #include "common.h"     /* NULL cripes */
29   #include "memory.h"
30 < #include "s_log.h"
32 < #include "fileio.h"
30 > #include "log.h"
31   #include "send.h"
32   #include "client.h"
33   #include "messages.tab"
# Line 91 | Line 89 | change_reply(const char *locale, int lin
89                for (; *old >= '0' && *old <= '9'; old++); /* skip size prefix */
90                if (*new != *old++)
91                {
92 <                ilog(L_ERROR, "Incompatible format symbols (%s.lang, %d)",
93 <                              locale, linecnt);
92 >                ilog(LOG_TYPE_IRCD, "Incompatible format symbols (%s.lang, %d)",
93 >                     locale, linecnt);
94                  return 0;
95                }
96                found = 1;
# Line 102 | Line 100 | change_reply(const char *locale, int lin
100          }
101          if (!found)
102          {
103 <          ilog(L_ERROR, "Too many format symbols (%s.lang, %d)", locale, linecnt);
103 >          ilog(LOG_TYPE_IRCD, "Too many format symbols (%s.lang, %d)", locale, linecnt);
104            return(0);
105          }
106        }
# Line 110 | Line 108 | change_reply(const char *locale, int lin
108    }
109  
110    MyFree(replies[reply].translated);
111 <  DupString(replies[reply].translated, new_reply);
111 >  replies[reply].translated = xstrdup(new_reply);
112    return(1);
113   }
114  
# Line 121 | Line 119 | set_locale(const char *locale)
119    int i, res = 1, linecnt = 0;
120    char buffer[IRCD_BUFSIZE + 1];
121    char *ident, *reply;
122 <  FBFILE *f;
122 >  FILE *f;
123  
124    /* Restore standard replies */
125    for (i = 0; i <= ERR_LAST_ERR_MSG; i++)   /* 0 isn't a magic number! ;> */
# Line 144 | Line 142 | set_locale(const char *locale)
142     * of MSGPATH.
143     */
144    snprintf(buffer, sizeof(buffer), "%s/%s.lang", MSGPATH, locale);
145 <  if ((f = fbopen(buffer, "r")) == NULL)
145 >  if ((f = fopen(buffer, "r")) == NULL)
146    {
147      strlcpy(used_locale, "standard", sizeof(used_locale));  /* XXX */
148      return;
149    }
150  
151    /* Process the language file */
152 <  while (fbgets(buffer, sizeof(buffer), f))
152 >  while (fgets(buffer, sizeof(buffer), f))
153    {
154      ++linecnt;
155      if (buffer[0] == ';')
# Line 176 | Line 174 | set_locale(const char *locale)
174        if (*reply != ':')
175        {
176          error:
177 <        ilog(L_ERROR, "Invalid line in language file (%s.lang, %d)",
178 <                      locale, linecnt);
177 >        ilog(LOG_TYPE_IRCD, "Invalid line in language file (%s.lang, %d)",
178 >             locale, linecnt);
179          res = 0;
180          continue;
181        }
# Line 206 | Line 204 | set_locale(const char *locale)
204      }
205      if (i != -1)
206      {
207 <      ilog(L_ERROR,
207 >      ilog(LOG_TYPE_IRCD,
208             "Unknown numeric %s (%s.lang, %d)", ident, locale, linecnt);
209        res = 0;
210      }
211    }
212 <  fbclose(f);
212 >  fclose(f);
213  
214    strlcpy(used_locale, locale, sizeof(used_locale));
215    if (!res)
216 <    sendto_realops_flags(UMODE_ALL, L_ADMIN, "Language file [%s] contains "
216 >    sendto_realops_flags(UMODE_ALL, L_ADMIN, SEND_NOTICE,
217 >                         "Language file [%s] contains "
218                           "errors, check server log file for more details",
219                           used_locale);
220   }

Diff Legend

Removed lines
+ Added lines
< Changed lines (old)
> Changed lines (new)