Find the message in a particular language SYNOPSIS find_message() err Error to find message for lang Language of message to find no_default Don't return default (English) if does not exit RETURN VALUE Returns the message structure if one is found, or NULL if not. */
| 677 | Returns the message structure if one is found, or NULL if not. |
| 678 | */ |
| 679 | static struct message *find_message(struct errors *err, const char *lang, |
| 680 | my_bool no_default) |
| 681 | { |
| 682 | struct message *tmp, *return_val= 0; |
| 683 | uint i, count; |
| 684 | DBUG_ENTER("find_message"); |
| 685 | |
| 686 | count= (err->msg).elements; |
| 687 | for (i= 0; i < count; i++) |
| 688 | { |
| 689 | tmp= dynamic_element(&err->msg, i, struct message*); |
| 690 | |
| 691 | if (!strcmp(tmp->lang_short_name, lang)) |
| 692 | DBUG_RETURN(tmp); |
| 693 | if (!strcmp(tmp->lang_short_name, default_language)) |
| 694 | { |
| 695 | DBUG_ASSERT(tmp->text[0] != 0); |
| 696 | return_val= tmp; |
| 697 | } |
| 698 | } |
| 699 | DBUG_RETURN(no_default ? NULL : return_val); |
| 700 | } |
| 701 | |
| 702 | |
| 703 |
no outgoing calls
no test coverage detected