+ terr.insertRef(getLineNumber(token), from_ascii("Citation undefined"),
+ from_utf8(token), child_name);
+ //"Reference `X' on page Y undefined on input line Z."
+ // This warning might be broken accross multiple lines with long labels.
+ // Thus we check that
+ } else if (contains(token, "Reference `") && !contains(token, "on input line")) {
+ // Rest of warning in next line(s)
+ // Save to ml_token
+ ml_token = token;
+ } else if (!ml_token.empty() && contains(ml_token, "Reference `")
+ && !contains(ml_token, "on input line")) {
+ // not finished yet. Continue with next line.
+ continue;
+ } else if (!ml_token.empty() && contains(ml_token, "Reference `")
+ && contains(ml_token, "on input line")) {
+ // We have collected the whole warning now.
+ if (!contains(ml_token, "undefined")) {
+ // Not the warning we are looking for
+ ml_token.clear();
+ continue;
+ }
+ if (regex_match(ml_token, sub, undef_ref)) {
+ string const ref = sub.str(1);
+ Buffer const * buf = theBufferList().getBufferFromTmp(file.absFileName());
+ if (!buf || !buf->masterBuffer()->activeLabel(from_utf8(ref))) {
+ terr.insertRef(getLineNumber(ml_token), from_ascii("Reference undefined"),
+ from_utf8(ml_token), child_name);
+ retval |= UNDEF_UNKNOWN_REF;
+ }
+ }
+ ml_token.clear();
+ retval |= UNDEF_REF;
+ } else if (contains(token, "Reference `")