Commit f315cd1470e21dee0dc48cc6b53ffbd30122c917

Brian Lopez 2018-01-03T18:44:12

make separators const a macro as well

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);
 				}