From 9529d3c2c647bf7c7aa1a2601d0209da98f8fa1e Mon Sep 17 00:00:00 2001 From: David Neto Date: Fri, 1 Oct 2021 08:43:59 -0400 Subject: [PATCH] Avoid implicit fallthrough, by duplicating code (#4556) The cleverness is probably not worth it. --- source/text_handler.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/source/text_handler.cpp b/source/text_handler.cpp index c31f34a6..46b98456 100644 --- a/source/text_handler.cpp +++ b/source/text_handler.cpp @@ -120,7 +120,8 @@ spv_result_t getWord(spv_text text, spv_position position, std::string* word) { case '\n': case '\r': if (escaping || quoting) break; - // Fall through. + word->assign(text->str + start_index, text->str + position->index); + return SPV_SUCCESS; case '\0': { // NOTE: End of word found! word->assign(text->str + start_index, text->str + position->index); return SPV_SUCCESS;