HyukjinKwon commented on code in PR #48674:
URL: https://github.com/apache/arrow/pull/48674#discussion_r2660006349
##########
cpp/src/arrow/status.cc:
##########
@@ -131,8 +132,15 @@ std::string Status::ToStringWithoutContextLines() const {
if (last_new_line_position == std::string::npos) {
break;
}
- // TODO: We may want to check /:\d+ /
- if (message.find(":", last_new_line_position) == std::string::npos) {
+ // Check for the pattern ":\d+" (colon followed by digits) to identify
+ // context lines in the format "filename:line expr"
+ auto colon_position = message.find(":", last_new_line_position);
+ if (colon_position == std::string::npos) {
+ break;
+ }
+ // Verify that the colon is followed by at least one digit
+ if (colon_position + 1 >= message.size() ||
+ !std::isdigit(static_cast<unsigned char>(message[colon_position +
1]))) {
Review Comment:
Sure!
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]