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


bug #36028: Problem escaping quotes

Submitted by:  None
Submitted on:  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

Add a New Comment (Rich Markup)

You are not logged in

Please log in, so followups can be emailed to you.


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)

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



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

Attach Files:

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


Do you think this task is very important?
If so, you can add your encouragement to it.
This task has 0 encouragements so far.

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.5