MCPcopy Create free account
hub / github.com/Meituan-Dianping/SQLAdvisor / parse_default_language

Function parse_default_language

extra/comp_err.c:632–664  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

630/* Parsing of the default language line. e.g. "default-language eng" */
631
632static char *parse_default_language(char *str)
633{
634 char *slang;
635
636 DBUG_ENTER("parse_default_language");
637 /* skipping the "default-language" keyword */
638 str= find_end_of_word(str);
639 /* skipping space(s) and/or tabs after the keyword */
640 str= skip_delimiters(str);
641 if (!*str)
642 {
643 fprintf(stderr,
644 "Unexpected EOL: No short language name after the keyword\n");
645 DBUG_RETURN(0);
646 }
647
648 /* reading the short language tag */
649 if (!(slang= get_word(&str)))
650 DBUG_RETURN(0); /* OOM: Fatal error */
651 DBUG_PRINT("info", ("default_slang: %s", slang));
652
653 str= skip_delimiters(str);
654 DBUG_PRINT("info", ("str: %s", str));
655 if (*str)
656 {
657 fprintf(stderr,
658 "The default language line does not end with short language "
659 "name\n");
660 DBUG_RETURN(0);
661 }
662 DBUG_PRINT("info", ("str: %s", str));
663 DBUG_RETURN(slang);
664}
665
666
667/*

Callers 1

parse_input_fileFunction · 0.85

Calls 3

find_end_of_wordFunction · 0.85
skip_delimitersFunction · 0.85
get_wordFunction · 0.85

Tested by

no test coverage detected