speechd-discuss
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

sd_generic - a little idea


From: Chris Brannon
Subject: sd_generic - a little idea
Date: Mon, 23 Aug 2010 03:11:25 -0500

Hynek Hanke <hanke at brailcom.org> writes:

> The current approach was more generic as it allowed
> you to pass the text as argument in case pipe mode is not
> supported by the synthesizer or create chains of commands.
>
> Would the problem be fixed if the text was escaped
> properly, before executing the command?

Yes, it would.
In all of the *-generic.conf config files, $DATA is surrounded by single
quotes.  The current version of generic.c escapes ", `, and \, but not
'.  The three characters `, \, and " don't even need to be escaped in a
single-quoted string, since they are interpreted literally.  There's no
way to put ' into the string.  We have to close the string, write \',
and re-open it.  Here's the algorithm in Python:

output = ''
for char in input:
    if char != "'": # Not a single quote
        output += char
    else: # Escape it.
        output += "'\\''"

I can send that patch, if you like.

-- Chris
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: not available
URL: 
<http://lists.freebsoft.org/pipermail/speechd/attachments/20100823/332a3eee/attachment.pgp>


reply via email to

[Prev in Thread] Current Thread [Next in Thread]