From a2e332cded1f1b0e478392e71468452d3ec984b9 Mon Sep 17 00:00:00 2001 From: David Shaw Date: Wed, 28 Jul 2004 04:12:50 +0000 Subject: * misc.c (optsep): Add the ability to understand keyword="quoted arg with spaces" type options. --- g10/ChangeLog | 5 +++++ g10/misc.c | 18 +++++++++++++++--- 2 files changed, 20 insertions(+), 3 deletions(-) diff --git a/g10/ChangeLog b/g10/ChangeLog index adabf3fc5..5d623f83a 100644 --- a/g10/ChangeLog +++ b/g10/ChangeLog @@ -1,3 +1,8 @@ +2004-07-27 David Shaw + + * misc.c (optsep): Add the ability to understand keyword="quoted + arg with spaces" type options. + 2004-07-16 David Shaw * keylist.c (list_keyblock_print): Always use the new listing diff --git a/g10/misc.c b/g10/misc.c index 9ffe09de7..51c0e6757 100644 --- a/g10/misc.c +++ b/g10/misc.c @@ -673,11 +673,23 @@ optsep(char **stringp) ptr++; } - /* There is an argument, so grab that too. */ + /* There is an argument, so grab that too. At this point, + ptr points to the first character of the argument. */ if(sawequals) - end=strpbrk(ptr," ,"); + { + /* Is it a quoted argument? */ + if(*ptr=='"') + { + ptr++; + end=strchr(ptr,'"'); + if(end) + end++; + } + else + end=strpbrk(ptr," ,"); + } - if(end) + if(end && *end) { *end='\0'; *stringp=end+1; -- cgit v1.2.3