]> git.mxchange.org Git - flightgear.git/commitdiff
- turn \n, \t, \r into spaces. Otherwise Festival spells out ".^M" as
authormfranz <mfranz>
Fri, 23 Mar 2007 10:45:11 +0000 (10:45 +0000)
committermfranz <mfranz>
Fri, 23 Mar 2007 10:45:11 +0000 (10:45 +0000)
  "period".
- fix rather embarrassing string concatenation bug  :-)

src/Sound/voice.cxx

index de77cbdf157872aa3654017ff8c63fae1e33a2fd..4bf45200350ae02c54da4b351122309d32809a88 100644 (file)
@@ -242,15 +242,17 @@ void FGVoiceMgr::FGVoice::FGVoiceListener::valueChanged(SGPropertyNode *node)
                return;
 
        const string s = node->getStringValue();
-//     cerr << "PUSH " << s << endl;
+       //cerr << "\033[31;1mPUSH [" << s << "]\033[m" << endl;
 
        string m;
        for (unsigned int i = 0; i < s.size(); i++) {
                char c = s[i];
-               if (!isprint(c))
+               if (c == '\n' || c == '\r' || c == '\t')
+                       m += ' ';
+               else if (!isprint(c))
                        continue;
-               else if (c == '"' || c == '\\')
-                       m += '\\' + c;
+               else if (c == '\\' || c == '"')
+                       m += '\\', m += c;
                else if (c == '|' || c == '_')
                        m += ' ';       // don't say "vertical bar" or "underscore"
                else if (c == '&')