help-gengetopt
[Top][All Lists]
Advanced

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

Re: [help-gengetopt] cmdline_file_save accepts file handler instead


From: Papp Gyozo (VBuster)
Subject: Re: [help-gengetopt] cmdline_file_save accepts file handler instead
Date: Wed, 17 Oct 2007 19:26:40 +0200

Hi there,

> concerning the patch for config file, my tests for config file parsers fail:
> 
> test_conf_parser:./test_conf.conf:7: malformed string in configuration file
> FAIL: test_conf_parser.sh
> could you please check this?

OK, I'll test it with gengetopt 2.21.

> does this test fail for you too?  You can try this by running make clean 
> && make check in the tests directory.

Wrong patch indeed. Somehow I stripped one line from it ...

@@ -702,9 +720,11 @@
             }
         }
       else
-        { /* read up the remaining part up to a delimiter */
-          next_token = strcspn (farg, " \t\r\n#\'\"");
-          str_index += next_token;

The last line to remove actually should be left intact as the last operation in 
this block (maybe better but I think still not so good):

@@ -574,8 +572,11 @@
             }
         }
       else
-        { /* read up the remaining part up to a delimiter */
-          next_token = strcspn (farg, " \t\r\n#\'\"");
+        { /* read up the remaining part up to end of line or comment sign */
+          char *ch = (str_index + (next_token = strcspn (farg, "\r\n#")));
+          /* remove trailing whitespaces */
+          for ( --ch; (*ch >= 0x09 && *ch <= 0x0D) || *ch == ' '; --ch )
+            --next_token;
           str_index += next_token;
         }
 
I assume test_conf_err_string2.conf test failed on the unterminated 
multi-string.




reply via email to

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