gnupg/g10 (ChangeLog exec.c exec.h g10.c keyserver.c)

cvs user dshaw cvs at cvs.gnupg.org
Thu Mar 31 18:57:00 CEST 2005


    Date: Thursday, March 31, 2005 @ 19:11:53
  Author: dshaw
    Path: /cvs/gnupg/gnupg/g10

Modified: ChangeLog exec.c exec.h g10.c keyserver.c

* exec.h, exec.c (set_exec_path): Remove some dead code and change all
callers.  We no longer need to append to $PATH.


-------------+
 ChangeLog   |    5 +++++
 exec.c      |   26 +++++++-------------------
 exec.h      |    4 ++--
 g10.c       |    2 +-
 keyserver.c |    2 +-
 5 files changed, 16 insertions(+), 23 deletions(-)


Index: gnupg/g10/ChangeLog
diff -u gnupg/g10/ChangeLog:1.716 gnupg/g10/ChangeLog:1.717
--- gnupg/g10/ChangeLog:1.716	Thu Mar 31 09:05:35 2005
+++ gnupg/g10/ChangeLog	Thu Mar 31 19:11:53 2005
@@ -1,3 +1,8 @@
+2005-03-31  David Shaw  <dshaw at jabberwocky.com>
+
+	* exec.h, exec.c (set_exec_path): Remove some dead code and change
+	all callers.  We no longer need to append to $PATH.
+
 2005-03-31  Werner Koch  <wk at g10code.com>
 
 	* keydb.c (keydb_add_resource): Clarify meaning of flags.  Add new
Index: gnupg/g10/exec.c
diff -u gnupg/g10/exec.c:1.18 gnupg/g10/exec.c:1.19
--- gnupg/g10/exec.c:1.18	Thu Oct 28 04:14:06 2004
+++ gnupg/g10/exec.c	Thu Mar 31 19:11:53 2005
@@ -1,5 +1,5 @@
 /* exec.c - generic call-a-program code
- * Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc.
+ * Copyright (C) 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
  *
  * This file is part of GnuPG.
  *
@@ -51,7 +51,7 @@
 
 int exec_read(struct exec_info *info) { return G10ERR_GENERAL; }
 int exec_finish(struct exec_info *info) { return G10ERR_GENERAL; }
-int set_exec_path(const char *path,int method) { return G10ERR_GENERAL; }
+int set_exec_path(const char *path) { return G10ERR_GENERAL; }
 
 #else /* ! NO_EXEC */
 
@@ -91,29 +91,17 @@
 }
 #endif
 
-/* method==0 to replace current $PATH, and 1 to append to current
-   $PATH.  */
-int set_exec_path(const char *path,int method)
+/* Replaces current $PATH */
+int set_exec_path(const char *path)
 {
-  char *p,*curpath=NULL;
-  size_t curlen=0;
+  char *p;
 
-  if(method==1 && (curpath=getenv("PATH")))
-    curlen=strlen(curpath)+1;
-
-  p=m_alloc(5+curlen+strlen(path)+1);
+  p=m_alloc(5+strlen(path)+1);
   strcpy(p,"PATH=");
-
-  if(curpath)
-    {
-      strcat(p,curpath);
-      strcat(p,":");
-    }
-
   strcat(p,path);
 
   if(DBG_EXTPROG)
-    log_debug("set_exec_path method %d: %s\n",method,p);
+    log_debug("set_exec_path: %s\n",p);
 
   /* Notice that path is never freed.  That is intentional due to the
      way putenv() works.  This leaks a few bytes if we call
Index: gnupg/g10/exec.h
diff -u gnupg/g10/exec.h:1.5 gnupg/g10/exec.h:1.6
--- gnupg/g10/exec.h:1.5	Wed May 21 18:42:21 2003
+++ gnupg/g10/exec.h	Thu Mar 31 19:11:53 2005
@@ -1,5 +1,5 @@
 /* exec.h
- * Copyright (C) 2001, 2002 Free Software Foundation, Inc.
+ * Copyright (C) 2001, 2002, 2005 Free Software Foundation, Inc.
  *
  * This file is part of GnuPG.
  *
@@ -38,6 +38,6 @@
 	       const char *args_in,const char *name,int writeonly,int binary);
 int exec_read(struct exec_info *info);
 int exec_finish(struct exec_info *info);
-int set_exec_path(const char *path,int method);
+int set_exec_path(const char *path);
 
 #endif /* !_EXEC_H_ */
Index: gnupg/g10/g10.c
diff -u gnupg/g10/g10.c:1.298 gnupg/g10/g10.c:1.299
--- gnupg/g10/g10.c:1.298	Thu Mar 31 09:05:35 2005
+++ gnupg/g10/g10.c	Thu Mar 31 19:11:53 2005
@@ -2379,7 +2379,7 @@
 	    break;
 	  case oTempDir: opt.temp_dir=pargs.r.ret_str; break;
 	  case oExecPath:
-	    if(set_exec_path(pargs.r.ret_str,0))
+	    if(set_exec_path(pargs.r.ret_str))
 	      log_error(_("unable to set exec-path to %s\n"),pargs.r.ret_str);
 	    else
 	      opt.exec_path_set=1;
Index: gnupg/g10/keyserver.c
diff -u gnupg/g10/keyserver.c:1.83 gnupg/g10/keyserver.c:1.84
--- gnupg/g10/keyserver.c:1.83	Thu Mar 31 05:58:53 2005
+++ gnupg/g10/keyserver.c	Thu Mar 31 19:11:53 2005
@@ -876,7 +876,7 @@
      Unix-like systems (since we're going to give a full path to
      gpgkeys_foo), but on W32 it prevents loading any DLLs from
      directories in %PATH%. */
-  set_exec_path(GNUPG_LIBEXECDIR,0);
+  set_exec_path(GNUPG_LIBEXECDIR);
 #else
   if(opt.exec_path_set)
     {




More information about the Gnupg-commits mailing list