make separators const a macro as well

parent fb29ba09
...@@ -12,6 +12,7 @@ ...@@ -12,6 +12,7 @@
#include <ctype.h> #include <ctype.h>
#define COMMENT_LINE_CHAR '#' #define COMMENT_LINE_CHAR '#'
#define TRAILER_SEPARATORS ":"
static const char *const git_generated_prefixes[] = { static const char *const git_generated_prefixes[] = {
"Signed-off-by: ", "Signed-off-by: ",
...@@ -19,8 +20,6 @@ static const char *const git_generated_prefixes[] = { ...@@ -19,8 +20,6 @@ static const char *const git_generated_prefixes[] = {
NULL NULL
}; };
static const char *const separators = ":";
static int is_blank_line(const char *str) static int is_blank_line(const char *str)
{ {
const char *s = str; const char *s = str;
...@@ -223,7 +222,7 @@ static int find_trailer_start(const char *buf, size_t len) ...@@ -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])) { if (separator_pos >= 1 && !isspace(bol[0])) {
trailer_lines++; trailer_lines++;
possible_continuation_lines = 0; possible_continuation_lines = 0;
...@@ -317,7 +316,7 @@ int git_message_trailers(const char *message, git_message_trailer_cb cb, void *p ...@@ -317,7 +316,7 @@ int git_message_trailers(const char *message, git_message_trailer_cb cb, void *p
NEXT(S_KEY_WS); NEXT(S_KEY_WS);
} }
if (strchr(separators, *ptr)) { if (strchr(TRAILER_SEPARATORS, *ptr)) {
*ptr = 0; *ptr = 0;
NEXT(S_SEP_WS); NEXT(S_SEP_WS);
} }
...@@ -334,7 +333,7 @@ int git_message_trailers(const char *message, git_message_trailer_cb cb, void *p ...@@ -334,7 +333,7 @@ int git_message_trailers(const char *message, git_message_trailer_cb cb, void *p
NEXT(S_KEY_WS); NEXT(S_KEY_WS);
} }
if (strchr(separators, *ptr)) { if (strchr(TRAILER_SEPARATORS, *ptr)) {
NEXT(S_SEP_WS); NEXT(S_SEP_WS);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment