| 716 | } |
| 717 | |
| 718 | static char *host_end(char **hoststart, int removebrackets) |
| 719 | { |
| 720 | char *host = *hoststart; |
| 721 | char *end; |
| 722 | char *start = strstr(host, "@["); |
| 723 | if (start) |
| 724 | start++; /* Jump over '@' */ |
| 725 | else |
| 726 | start = host; |
| 727 | if (start[0] == '[') { |
| 728 | end = strchr(start + 1, ']'); |
| 729 | if (end) { |
| 730 | if (removebrackets) { |
| 731 | *end = 0; |
| 732 | memmove(start, start + 1, end - start); |
| 733 | end++; |
| 734 | } |
| 735 | } else |
| 736 | end = host; |
| 737 | } else |
| 738 | end = host; |
| 739 | return end; |
| 740 | } |
| 741 | |
| 742 | #define STR_(s) # s |
| 743 | #define STR(s) STR_(s) |
no outgoing calls
no test coverage detected