diff options
author | Brian Lopez <seniorlopez@gmail.com> | 2018-01-03 18:44:12 -0800 |
---|---|---|
committer | Brian Lopez <seniorlopez@gmail.com> | 2018-01-03 18:44:12 -0800 |
commit | f315cd1470e21dee0dc48cc6b53ffbd30122c917 (patch) | |
tree | e0ee5ccd05ed89eb6a0567b5cdc05040517ec9d3 | |
parent | fb29ba0953ef52ce94aecd93b9b4a3bcc64cf07c (diff) | |
download | libgit2-f315cd1470e21dee0dc48cc6b53ffbd30122c917.tar.gz |
make separators const a macro as well
-rw-r--r-- | src/trailer.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/trailer.c b/src/trailer.c index b03e27f14..cfefc530c 100644 --- a/src/trailer.c +++ b/src/trailer.c @@ -12,6 +12,7 @@ #include <ctype.h> #define COMMENT_LINE_CHAR '#' +#define TRAILER_SEPARATORS ":" static const char *const git_generated_prefixes[] = { "Signed-off-by: ", @@ -19,8 +20,6 @@ static const char *const git_generated_prefixes[] = { NULL }; -static const char *const separators = ":"; - static int is_blank_line(const char *str) { const char *s = str; @@ -223,7 +222,7 @@ static int find_trailer_start(const char *buf, size_t len) } } - separator_pos = find_separator(bol, separators); + separator_pos = find_separator(bol, TRAILER_SEPARATORS); if (separator_pos >= 1 && !isspace(bol[0])) { trailer_lines++; possible_continuation_lines = 0; @@ -317,7 +316,7 @@ int git_message_trailers(const char *message, git_message_trailer_cb cb, void *p NEXT(S_KEY_WS); } - if (strchr(separators, *ptr)) { + if (strchr(TRAILER_SEPARATORS, *ptr)) { *ptr = 0; NEXT(S_SEP_WS); } @@ -334,7 +333,7 @@ int git_message_trailers(const char *message, git_message_trailer_cb cb, void *p NEXT(S_KEY_WS); } - if (strchr(separators, *ptr)) { + if (strchr(TRAILER_SEPARATORS, *ptr)) { NEXT(S_SEP_WS); } |