On Tue, Jan 23, 2007 at 05:16:44PM +0000, Ben Pfaff wrote:
I'd suggest adding a function, analogous to the "quote" function in gnulib,
that returns its argument as a quoted string in syntax format. It could
return it in single quotes if it doesn't contain a single quote, in double
quotes if it doesn't contain a double quote, or in single quotes with
doubled
single quotes otherwise. If we don't do something like this, then we end
up
with little ticking time bombs of code like this:
+ sss = create_syntax_string_source ("EXPORT OUTFILE='%s'.",
+ de->file_name);Good point. Such a function however is not entirely trivial. There's two problems that I can see: 1. How to make it robust and tolerant of multi-byte encodings. 2. Either it must allocate heap space for its return value, in which case the caller must free it, or it can use a static buffer, which causes other problems. Maybe I'll make a stub for this function, and think about how to do it properly at a later date. J' -- PGP Public key ID: 1024D/2DE827B3 fingerprint = 8797 A26D 0854 2EAB 0285 A290 8A67 719C 2DE8 27B3 See http://pgp.mit.edu or any PGP keyserver for public key.
signature.asc
Description: Digital signature
_______________________________________________ pspp-dev mailing list [email protected] http://lists.gnu.org/mailman/listinfo/pspp-dev
