[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [patch #5704] Data New/Open/Save
From: |
John Darrington |
Subject: |
Re: [patch #5704] Data New/Open/Save |
Date: |
Wed, 24 Jan 2007 06:25:00 +0900 |
User-agent: |
Mutt/1.5.13 (2006-08-11) |
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
- [patch #5704] Data New/Open/Save, John Darrington, 2007/01/23
- [patch #5704] Data New/Open/Save, Ben Pfaff, 2007/01/23
- Re: [patch #5704] Data New/Open/Save,
John Darrington <=
- Re: [patch #5704] Data New/Open/Save, Ben Pfaff, 2007/01/23
- Re: [patch #5704] Data New/Open/Save, John Darrington, 2007/01/23
- Re: [patch #5704] Data New/Open/Save, Ben Pfaff, 2007/01/23
- Re: [patch #5704] Data New/Open/Save, John Darrington, 2007/01/23
- Re: [patch #5704] Data New/Open/Save, Ben Pfaff, 2007/01/23
[patch #5704] Data New/Open/Save, John Darrington, 2007/01/24