added fast-import to import-options
[gnupg.git] / g10 / exec.c
index a585fb7..f220dd3 100644 (file)
@@ -178,7 +178,7 @@ static int make_tempdir(struct exec_info *info)
 #endif
 
   if(mkdtemp(info->tempdir)==NULL)
-    log_error(_("%s: can't create directory: %s\n"),
+    log_error(_("can't create directory `%s': %s\n"),
              info->tempdir,strerror(errno));
   else
     {
@@ -262,9 +262,14 @@ static int expand_args(struct exec_info *info,const char *args_in)
 
          if(append)
            {
-             while(strlen(append)+len>size-1)
+             size_t applen=strlen(append);
+
+             if(applen+len>size-1)
                {
-                 size+=100;
+                 if(applen<100)
+                   applen=100;
+
+                 size+=applen;
                  info->command=m_realloc(info->command,size);
                }
 
@@ -464,13 +469,13 @@ int exec_write(struct exec_info **info,const char *program,
 #endif /* !EXEC_TEMPFILE_ONLY */
 
   if(DBG_EXTPROG)
-    log_debug("using temp file \"%s\"\n",(*info)->tempfile_in);
+    log_debug("using temp file `%s'\n",(*info)->tempfile_in);
 
   /* It's not fork/exec/pipe, so create a temp file */
   (*info)->tochild=fopen((*info)->tempfile_in,binary?"wb":"w");
   if((*info)->tochild==NULL)
     {
-      log_error(_("%s: can't create: %s\n"),
+      log_error(_("can't create `%s': %s\n"),
                (*info)->tempfile_in,strerror(errno));
       ret=G10ERR_WRITE_FILE;
       goto fail;
@@ -583,19 +588,19 @@ int exec_finish(struct exec_info *info)
       if(info->tempfile_in)
        {
          if(unlink(info->tempfile_in)==-1)
-           log_info(_("WARNING: unable to remove tempfile (%s) \"%s\": %s\n"),
+           log_info(_("WARNING: unable to remove tempfile (%s) `%s': %s\n"),
                     "in",info->tempfile_in,strerror(errno));
        }
   
       if(info->tempfile_out)
        {
          if(unlink(info->tempfile_out)==-1)
-           log_info(_("WARNING: unable to remove tempfile (%s) \"%s\": %s\n"),
+           log_info(_("WARNING: unable to remove tempfile (%s) `%s': %s\n"),
                     "out",info->tempfile_out,strerror(errno));
        }
 
       if(rmdir(info->tempdir)==-1)
-       log_info(_("WARNING: unable to remove temp directory \"%s\": %s\n"),
+       log_info(_("WARNING: unable to remove temp directory `%s': %s\n"),
                 info->tempdir,strerror(errno));
     }
 
@@ -609,3 +614,4 @@ int exec_finish(struct exec_info *info)
   return ret;
 }
 #endif /* ! NO_EXEC */
+