bugGNU Gengetopt - Bugs: bug #36028, Problem escaping quotes

 
 

bug #36028: Problem escaping quotes

Submitter:  None
Submitted:  Wed 28 Mar 2012 08:52:17 PM UTC
   
 
Category:  None Severity:  3 - Normal
Item Group:  None Status:  None
Privacy:  Public Assigned to:  None
Originator Name:  Open/Closed:  Open
* Mandatory Fields

Add a New Comment Rich Markup
   

Thu 29 Mar 2012 07:40:18 AM UTC, comment #1: 

Find attached a possible fix for (2). Note that this will still fail if the line ends in a comment with a quote.

(file #25503)

Anonymous
Wed 28 Mar 2012 08:52:17 PM UTC, original submission:  

1. Escaping quotes on the command line works, e.g., gengetopt --unamed-opts="a \\\"b\\\"", but from within a ggo-file it does not: args "--unamed-opts=\"a b\""

2. Parsing config files with cmdline_parser_config_file() fails with unescaped quotes. Consider following example:

package "test_escape"
version "1.0"
args "--conf-parser"
option "test" t "Test option" string optional


Running test_escape -t "test \"escape\"" with cmdline_parser_file_save("args.txt", ...) will create a file args.txt with test="test "escape"" (quotes are not escaped properly). Parsing that file fails:
test_escape:args.txt:1: malformed string in configuration file

Anonymous

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

Attached Files
file #25503:  c_source.h_skel.diff added by None (580B - application/octet-stream - Patch cmdline_parser_config_file() to support quotes in optargs)

 

Depends on the following items: None found

Items that depend on this one: None found

 

CC list is empty

 

There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

Only logged-in users can vote.

 

Follows 1 latest change.

Date Changed by Updated Field Previous Value => Replaced by
2012-03-29 None Attached File- Added c_source.h_skel.diff, #25503

Back to the top

Powered by Savane 3.13-4b4b.
Corresponding source code