From a695245fa9c132a09fd1662a4be7abd15d76019b Mon Sep 17 00:00:00 2001 From: David Kastrup Date: Sun, 1 Jan 2012 17:56:07 +0100 Subject: [PATCH] lexer.ll: remove old and buggy TeX cruft --- lily/lexer.ll | 26 +++++++------------------- 1 file changed, 7 insertions(+), 19 deletions(-) diff --git a/lily/lexer.ll b/lily/lexer.ll index 1777398f8a..ce3bf9c516 100644 --- a/lily/lexer.ll +++ b/lily/lexer.ll @@ -1046,30 +1046,18 @@ is_valid_version (string s) /* - substitute _ and \, + substitute _ */ string lyric_fudge (string s) { - char *chars = string_copy (s); + size_t i=0; - for (char *p = chars; *p ; p++) - { - if (*p == '_' && (p == chars || *(p-1) != '\\')) - *p = ' '; - } - - s = string (chars); - delete[] chars; - - ssize i = 0; - if ((i = s.find ("\\,")) != NPOS) // change "\," to TeX's "\c " - { - * (((char*)s.c_str ()) + i + 1) = 'c'; - s = s.substr (0, i + 2) + " " + s.substr (i - 2); - } - - return s; + while ((i = s.find ('_', i)) != string::npos) + { + s[i++] = ' '; + } + return s; } /* -- 2.39.2