summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrian Lopez <seniorlopez@gmail.com>2018-01-03 18:44:12 -0800
committerBrian Lopez <seniorlopez@gmail.com>2018-01-03 18:44:12 -0800
commitf315cd1470e21dee0dc48cc6b53ffbd30122c917 (patch)
treee0ee5ccd05ed89eb6a0567b5cdc05040517ec9d3
parentfb29ba0953ef52ce94aecd93b9b4a3bcc64cf07c (diff)
downloadlibgit2-f315cd1470e21dee0dc48cc6b53ffbd30122c917.tar.gz
make separators const a macro as well
-rw-r--r--src/trailer.c9
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);
}