| 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" |
| 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; |
| 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 |
|
} |
| 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 |
|
|
| 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! ;> */ |
| 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] == ';') |
| 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 |
|
} |
| 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 |
|
} |