Skip to content

Commit 442ed67

Browse files
committed
string-list: report programming error with BUG
Passing a string list that has .strdup_strings bit unset to string_list_split(), or one that has .strdup_strings bit set to string_list_split_in_place(), is a programmer error. Do not use die() to abort the execution. Use BUG() instead. As a developer-facing message, the message string itself should be a lot more concise, but let's keep the original one for now. Signed-off-by: Junio C Hamano <[email protected]>
1 parent e813a02 commit 442ed67

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

string-list.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,7 @@ int string_list_split(struct string_list *list, const char *string,
283283
const char *p = string, *end;
284284

285285
if (!list->strdup_strings)
286-
die("internal error in string_list_split(): "
286+
BUG("internal error in string_list_split(): "
287287
"list->strdup_strings must be set");
288288
for (;;) {
289289
count++;
@@ -309,7 +309,7 @@ int string_list_split_in_place(struct string_list *list, char *string,
309309
char *p = string, *end;
310310

311311
if (list->strdup_strings)
312-
die("internal error in string_list_split_in_place(): "
312+
BUG("internal error in string_list_split_in_place(): "
313313
"list->strdup_strings must not be set");
314314
for (;;) {
315315
count++;

0 commit comments

Comments
 (0)