From 02b3708cd5dfa1d4b4046468a4873d143f56fec8 Mon Sep 17 00:00:00 2001 From: Ryan Blue Date: Sat, 18 Mar 2023 02:33:56 -0400 Subject: [PATCH] Allow UnescapeCString to handle escaped quotes --- hal/src/main/native/athena/HAL.cpp | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/hal/src/main/native/athena/HAL.cpp b/hal/src/main/native/athena/HAL.cpp index eda229af950..b6e2b3a6d0f 100644 --- a/hal/src/main/native/athena/HAL.cpp +++ b/hal/src/main/native/athena/HAL.cpp @@ -316,11 +316,7 @@ void InitializeRoboRioComments(void) { return; } start += searchString.size(); - size_t end = fileContents.find("\"", start); - if (end == std::string_view::npos) { - end = fileContents.size(); - } - std::string_view escapedComments = wpi::slice(fileContents, start, end); + std::string_view escapedComments = wpi::slice(fileContents, start, fileContents.size()); wpi::SmallString<64> buf; auto [unescapedComments, rem] = wpi::UnescapeCString(escapedComments, buf); unescapedComments.copy(roboRioCommentsString,