Skip to content

Commit f315cd1

Browse files
committed
make separators const a macro as well
1 parent fb29ba0 commit f315cd1

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

src/trailer.c

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,14 @@
1212
#include <ctype.h>
1313

1414
#define COMMENT_LINE_CHAR '#'
15+
#define TRAILER_SEPARATORS ":"
1516

1617
static const char *const git_generated_prefixes[] = {
1718
"Signed-off-by: ",
1819
"(cherry picked from commit ",
1920
NULL
2021
};
2122

22-
static const char *const separators = ":";
23-
2423
static int is_blank_line(const char *str)
2524
{
2625
const char *s = str;
@@ -223,7 +222,7 @@ static int find_trailer_start(const char *buf, size_t len)
223222
}
224223
}
225224

226-
separator_pos = find_separator(bol, separators);
225+
separator_pos = find_separator(bol, TRAILER_SEPARATORS);
227226
if (separator_pos >= 1 && !isspace(bol[0])) {
228227
trailer_lines++;
229228
possible_continuation_lines = 0;
@@ -317,7 +316,7 @@ int git_message_trailers(const char *message, git_message_trailer_cb cb, void *p
317316
NEXT(S_KEY_WS);
318317
}
319318

320-
if (strchr(separators, *ptr)) {
319+
if (strchr(TRAILER_SEPARATORS, *ptr)) {
321320
*ptr = 0;
322321
NEXT(S_SEP_WS);
323322
}
@@ -334,7 +333,7 @@ int git_message_trailers(const char *message, git_message_trailer_cb cb, void *p
334333
NEXT(S_KEY_WS);
335334
}
336335

337-
if (strchr(separators, *ptr)) {
336+
if (strchr(TRAILER_SEPARATORS, *ptr)) {
338337
NEXT(S_SEP_WS);
339338
}
340339

0 commit comments

Comments
 (0)