forked from github/server
eliminate dead code, fix compile
This commit is contained in:
parent
409f5df9a9
commit
7fa568da09
2 changed files with 5 additions and 38 deletions
|
@ -1036,12 +1036,14 @@ static int include_po(const char *uri) {
|
||||||
const char *filename = uri_to_file(uri, name, sizeof(name));
|
const char *filename = uri_to_file(uri, name, sizeof(name));
|
||||||
const char *pos = strstr(filename, ".po");
|
const char *pos = strstr(filename, ".po");
|
||||||
if (pos) {
|
if (pos) {
|
||||||
|
size_t len;
|
||||||
const char *str = --pos;
|
const char *str = --pos;
|
||||||
while (str > filename && *str != '.') --str;
|
while (str > filename && *str != '.') --str;
|
||||||
if ((pos - str) < sizeof(lname)) {
|
len = (size_t)(pos - str);
|
||||||
|
if (len < sizeof(lname)) {
|
||||||
struct locale * lang;
|
struct locale * lang;
|
||||||
memcpy(lname, str+1, pos - str);
|
memcpy(lname, str+1, len);
|
||||||
lname[pos - str] = 0;
|
lname[len] = 0;
|
||||||
lang = get_or_create_locale(lname);
|
lang = get_or_create_locale(lname);
|
||||||
if (lang) {
|
if (lang) {
|
||||||
int err = pofile_read(filename, add_po_string, lang);
|
int err = pofile_read(filename, add_po_string, lang);
|
||||||
|
|
|
@ -83,16 +83,6 @@ static variant xml_fraction(xmlNodePtr node, const char *name) {
|
||||||
return frac_make(0, 1);
|
return frac_make(0, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void xml_readtext(xmlNodePtr node, struct locale **lang, xmlChar ** text)
|
|
||||||
{
|
|
||||||
xmlChar *propValue = xmlGetProp(node, BAD_CAST "locale");
|
|
||||||
assert(propValue != NULL);
|
|
||||||
*lang = get_locale((const char *)propValue);
|
|
||||||
xmlFree(propValue);
|
|
||||||
|
|
||||||
*text = xmlNodeListGetString(node->doc, node->children, 1);
|
|
||||||
}
|
|
||||||
|
|
||||||
static spellref *xml_spellref(xmlNode * node, const char *name)
|
static spellref *xml_spellref(xmlNode * node, const char *name)
|
||||||
{
|
{
|
||||||
xmlChar *propValue = xmlGetProp(node, BAD_CAST name);
|
xmlChar *propValue = xmlGetProp(node, BAD_CAST name);
|
||||||
|
@ -104,31 +94,6 @@ static spellref *xml_spellref(xmlNode * node, const char *name)
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
static xmlChar *xml_cleanup_string(xmlChar * str)
|
|
||||||
{
|
|
||||||
xmlChar *read = str;
|
|
||||||
xmlChar *write = str;
|
|
||||||
|
|
||||||
while (*read) {
|
|
||||||
/* eat leading whitespace */
|
|
||||||
if (*read && isspace(*read)) {
|
|
||||||
while (*read && isspace(*read)) {
|
|
||||||
++read;
|
|
||||||
}
|
|
||||||
*write++ = ' ';
|
|
||||||
}
|
|
||||||
while (*read) {
|
|
||||||
if (*read == '\n')
|
|
||||||
break;
|
|
||||||
if (*read == '\r')
|
|
||||||
break;
|
|
||||||
*write++ = *read++;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
*write = 0;
|
|
||||||
return str;
|
|
||||||
}
|
|
||||||
|
|
||||||
static resource_mod * xml_readmodifiers(xmlXPathObjectPtr result, xmlNodePtr node) {
|
static resource_mod * xml_readmodifiers(xmlXPathObjectPtr result, xmlNodePtr node) {
|
||||||
/* reading eressea/resources/resource/modifier */
|
/* reading eressea/resources/resource/modifier */
|
||||||
if (result->nodesetval != NULL && result->nodesetval->nodeNr > 0) {
|
if (result->nodesetval != NULL && result->nodesetval->nodeNr > 0) {
|
||||||
|
|
Loading…
Reference in a new issue