mirror of
git://git.gnupg.org/gnupg.git
synced 2025-02-26 20:31:06 +01:00
* argparse.c (optfile_parse): Remove quotes only if they totally enclose
the string, and do not occur within the string. This makes specifying a program under Win32 easier when you need quotes around part of a string, but not around the whole string.
This commit is contained in:
parent
cc0074dc5a
commit
8b7d2475bb
@ -1,3 +1,10 @@
|
||||
2002-05-03 David Shaw <dshaw@jabberwocky.com>
|
||||
|
||||
* argparse.c (optfile_parse): Remove quotes only if they totally
|
||||
enclose the string, and do not occur within the string. This
|
||||
makes specifying a program under Win32 easier when you need quotes
|
||||
around part of a string, but not around the whole string.
|
||||
|
||||
2002-05-02 Werner Koch <wk@gnupg.org>
|
||||
|
||||
* memory.c (alloc): Malloc at least 1 byte. Noted by Winona Brown.
|
||||
|
@ -327,10 +327,19 @@ optfile_parse( FILE *fp, const char *filename, unsigned *lineno,
|
||||
|
||||
trim_spaces( buffer );
|
||||
p = buffer;
|
||||
if( *p == '"' ) { /* remove quotes */
|
||||
p++;
|
||||
if( *p && p[strlen(p)-1] == '"' )
|
||||
p[strlen(p)-1] = 0;
|
||||
/* remove quotes if they totally enclose the
|
||||
string, and do not occur within the string */
|
||||
if( *p == '"' && p[strlen(p)-1]=='"') {
|
||||
char *i=p;
|
||||
|
||||
while(*(++i))
|
||||
if(*i=='"')
|
||||
break;
|
||||
|
||||
if(*i=='"' && *(i+1)=='\0') {
|
||||
p[strlen(p)-1] = 0;
|
||||
p++;
|
||||
}
|
||||
}
|
||||
if( !set_opt_arg(arg, opts[idx].flags, p) )
|
||||
m_free(buffer);
|
||||
|
Loading…
x
Reference in New Issue
Block a user