aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Shaw <[email protected]>2004-07-28 04:12:50 +0000
committerDavid Shaw <[email protected]>2004-07-28 04:12:50 +0000
commita2e332cded1f1b0e478392e71468452d3ec984b9 (patch)
tree95265e0d3045e8ee059dce6afed75271a7b4a6fc
parent* gpgkeys_ldap.c (main): Don't try and error out before making a ldaps (diff)
downloadgnupg-a2e332cded1f1b0e478392e71468452d3ec984b9.tar.gz
gnupg-a2e332cded1f1b0e478392e71468452d3ec984b9.zip
* misc.c (optsep): Add the ability to understand keyword="quoted arg with
spaces" type options.
-rw-r--r--g10/ChangeLog5
-rw-r--r--g10/misc.c18
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 <[email protected]>
+
+ * misc.c (optsep): Add the ability to understand keyword="quoted
+ arg with spaces" type options.
+
2004-07-16 David Shaw <[email protected]>
* 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;