From 992524465a6de956204fb7d69424207514fe1f1c Mon Sep 17 00:00:00 2001 From: Craig Stuart Sapp Date: Wed, 25 Oct 2023 11:11:04 -0700 Subject: [PATCH] Implementation for issue https://github.com/humdrum-tools/verovio-humdrum-viewer/issues/863 --- src/iohumdrum.cpp | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/src/iohumdrum.cpp b/src/iohumdrum.cpp index a310f8fd521..2db32a4188e 100644 --- a/src/iohumdrum.cpp +++ b/src/iohumdrum.cpp @@ -18025,11 +18025,24 @@ hum::HTp HumdrumInput::getHairpinEnd(hum::HTp token, const std::string &endchar) if (token == NULL) { return NULL; } + int subtrack = token->getSubtrack(); + if (subtrack == 0) { + subtrack = 1; + } token = token->getNextNonNullDataToken(); int badtoken = 0; while (token != NULL) { if (token->find(endchar) != std::string::npos) { - return token; + int esubtrack = token->getSubtrack(); + if (esubtrack == 0) { + esubtrack = 1; + } + if (subtrack == esubtrack) { + return token; + } + else { + return NULL; + } } badtoken = 0; for (int i = 0; i < (int)token->size(); ++i) {