Sam Pullara commited on
Commit
fa6a8a8
·
unverified ·
1 Parent(s): afd6523

talk-llama : improve quote and backtick handling (#1364)

Browse files

* ISSUE-1329: replace " with ' so it doesn't try to execute code in backticks.

* Typo

* Update to keep possessives in the output

Closes the ' then puts a ' in quotes then reopens the ' to escape the ' characters.

Files changed (1) hide show
  1. examples/talk-llama/talk-llama.cpp +2 -2
examples/talk-llama/talk-llama.cpp CHANGED
@@ -686,8 +686,8 @@ int main(int argc, char ** argv) {
686
  }
687
  }
688
 
689
- text_to_speak = ::replace(text_to_speak, "\"", "");
690
- int ret = system((params.speak + " " + std::to_string(voice_id) + " \"" + text_to_speak + "\"").c_str());
691
  if (ret != 0) {
692
  fprintf(stderr, "%s: failed to speak\n", __func__);
693
  }
 
686
  }
687
  }
688
 
689
+ text_to_speak = ::replace(text_to_speak, "'", "'\"'\"'");
690
+ int ret = system((params.speak + " " + std::to_string(voice_id) + " '" + text_to_speak + "'").c_str());
691
  if (ret != 0) {
692
  fprintf(stderr, "%s: failed to speak\n", __func__);
693
  }