make separators const a macro as well
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48
diff --git a/src/trailer.c b/src/trailer.c
index b03e27f..cfefc53 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);
}