| 1923 | } |
| 1924 | |
| 1925 | const char *find_commit_header(const char *msg, const char *key, size_t *out_len) |
| 1926 | { |
| 1927 | int key_len = strlen(key); |
| 1928 | const char *line = msg; |
| 1929 | |
| 1930 | while (line) { |
| 1931 | const char *eol = strchrnul(line, '\n'); |
| 1932 | |
| 1933 | if (line == eol) |
| 1934 | return NULL; |
| 1935 | |
| 1936 | if (eol - line > key_len && |
| 1937 | !strncmp(line, key, key_len) && |
| 1938 | line[key_len] == ' ') { |
| 1939 | *out_len = eol - line - key_len - 1; |
| 1940 | return line + key_len + 1; |
| 1941 | } |
| 1942 | line = *eol ? eol + 1 : NULL; |
| 1943 | } |
| 1944 | return NULL; |
| 1945 | } |
| 1946 | |
| 1947 | /* |
| 1948 | * Inspect the given string and determine the true "end" of the log message, in |
no outgoing calls
no test coverage detected