chiark / gitweb /
dirmngr: Fix error handling.
[gnupg2.git] / tools / gpgconf-comp.c
index 180fd65c29aa998fccf2e16c8f0196f2a8e779c2..9358e2efac0d4fd943973517481c9d58012fbd9c 100644 (file)
@@ -716,6 +716,10 @@ static gc_option_t gc_options_gpg[] =
      (GC_OPT_FLAG_ARG_OPT|GC_OPT_FLAG_NO_CHANGE), GC_LEVEL_INVISIBLE,
      NULL, NULL,
      GC_ARG_TYPE_STRING, GC_BACKEND_GPG },
+   { "trust-model",
+     GC_OPT_FLAG_NONE, GC_LEVEL_INVISIBLE,
+     NULL, NULL,
+     GC_ARG_TYPE_STRING, GC_BACKEND_GPG },
 
 
    { "Debug",
@@ -743,6 +747,8 @@ static gc_option_t gc_options_gpg[] =
    { "auto-key-locate", GC_OPT_FLAG_NONE, GC_LEVEL_ADVANCED,
      "gnupg", N_("|MECHANISMS|use MECHANISMS to locate keys by mail address"),
      GC_ARG_TYPE_STRING, GC_BACKEND_GPG },
+   { "auto-key-retrieve", GC_OPT_FLAG_NONE, GC_LEVEL_INVISIBLE,
+     NULL, NULL, GC_ARG_TYPE_NONE, GC_BACKEND_GPG },
 
 
    GC_OPTION_NULL
@@ -1484,6 +1490,13 @@ gc_percent_escape (const char *src)
          *(dst++) = '2';
          *(dst++) = 'c';
        }
+      else if (*src == '\n')
+       {
+         /* The newline is problematic in a line-based format.  */
+         *(dst++) = '%';
+         *(dst++) = '0';
+         *(dst++) = 'a';
+       }
       else
        *(dst++) = *(src);
       src++;
@@ -2163,8 +2176,11 @@ retrieve_options_from_program (gc_component_t component, gc_backend_t backend)
 
   config = es_fopen (config_filename, "r");
   if (!config)
-    gc_error (0, errno, "warning: can not open config file %s",
-             config_filename);
+    {
+      if (errno != ENOENT)
+        gc_error (0, errno, "warning: can not open config file %s",
+                  config_filename);
+    }
   else
     {
       while ((length = es_read_line (config, &line, &line_len, NULL)) > 0)