| 591 | |
| 592 | |
| 593 | static uint parse_error_offset(char *str) |
| 594 | { |
| 595 | char *soffset, *end; |
| 596 | int error; |
| 597 | uint ioffset; |
| 598 | |
| 599 | DBUG_ENTER("parse_error_offset"); |
| 600 | /* skipping the "start-error-number" keyword and spaces after it */ |
| 601 | str= find_end_of_word(str); |
| 602 | str= skip_delimiters(str); |
| 603 | |
| 604 | if (!*str) |
| 605 | DBUG_RETURN(0); /* Unexpected EOL: No error number after the keyword */ |
| 606 | |
| 607 | /* reading the error offset */ |
| 608 | if (!(soffset= get_word(&str))) |
| 609 | DBUG_RETURN(0); /* OOM: Fatal error */ |
| 610 | DBUG_PRINT("info", ("default_error_offset: %s", soffset)); |
| 611 | |
| 612 | /* skipping space(s) and/or tabs after the error offset */ |
| 613 | str= skip_delimiters(str); |
| 614 | DBUG_PRINT("info", ("str: %s", str)); |
| 615 | if (*str) |
| 616 | { |
| 617 | /* The line does not end with the error offset -> error! */ |
| 618 | fprintf(stderr, "The error offset line does not end with an error offset"); |
| 619 | DBUG_RETURN(0); |
| 620 | } |
| 621 | DBUG_PRINT("info", ("str: %s", str)); |
| 622 | |
| 623 | end= 0; |
| 624 | ioffset= (uint) my_strtoll10(soffset, &end, &error); |
| 625 | my_free(soffset); |
| 626 | DBUG_RETURN(ioffset); |
| 627 | } |
| 628 | |
| 629 | |
| 630 | /* Parsing of the default language line. e.g. "default-language eng" */ |
no test coverage detected