diff --git a/g10/ChangeLog b/g10/ChangeLog index cc7b2c167..a11428f8f 100644 --- a/g10/ChangeLog +++ b/g10/ChangeLog @@ -1,3 +1,11 @@ +2001-12-25 David Shaw + + * mkdtemp.c (mkdtemp): Add copyleft info and tweak the 'X' counter + to be a bit simpler. + + * keyserver.c, photoid.c: Remove unused headers left over from + when the exec functions lived there. + 2001-12-23 Timo Schulz * misc.c (check_permissions): Do not use it for W32 systems. diff --git a/g10/keyserver.c b/g10/keyserver.c index b77d2609d..66e62df9a 100644 --- a/g10/keyserver.c +++ b/g10/keyserver.c @@ -19,29 +19,24 @@ */ #include +#include +#include #include #include -#include -#include -#include -#include -#include -#ifndef HAVE_DOSISH_SYSTEM -#include -#endif -#include -#include -#include "keyserver-internal.h" -#include "types.h" -#include "options.h" -#include "memory.h" + +#include "util.h" +#include "filter.h" #include "keydb.h" #include "status.h" #include "exec.h" -#include "i18n.h" -#include "util.h" #include "main.h" +#include "i18n.h" #include "hkp.h" +#include "iobuf.h" +#include "memory.h" +#include "options.h" +#include "packet.h" +#include "keyserver-internal.h" #define KEYSERVER_PROTO_VERSION 0 diff --git a/g10/mkdtemp.c b/g10/mkdtemp.c index 50a083005..0323486a3 100644 --- a/g10/mkdtemp.c +++ b/g10/mkdtemp.c @@ -1,3 +1,23 @@ +/* mkdtemp.c - libc replacement function + * Copyright (C) 2001 Free Software Foundation, Inc. + * + * This file is part of GnuPG. + * + * GnuPG is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * GnuPG is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA + */ + /* This is a replacement function for mkdtemp in case the platform we're building on (like mine!) doesn't have it. */ @@ -23,29 +43,21 @@ char *mkdtemp(char *template) idx=strlen(template); - if(idx==0) - { - errno=EINVAL; - return NULL; - } - - ch=&template[idx-1]; - /* Walk backwards to count all the Xes */ - while(*ch=='X' && count0 && template[idx-1]=='X') { count++; - ch--; + idx--; } - ch++; - if(count==0) { errno=EINVAL; return NULL; } + ch=&template[idx]; + /* Try 4 times to make the temp directory */ for(attempts=0;attempts<4;attempts++) { diff --git a/g10/photoid.c b/g10/photoid.c index 88d3f8233..8586f0ee5 100644 --- a/g10/photoid.c +++ b/g10/photoid.c @@ -19,30 +19,23 @@ */ #include -#include +#include #include #include -#include -#include -#ifndef HAVE_DOSISH_SYSTEM -#include -#endif -#include -#include -#include "keydb.h" -#include "i18n.h" -#include "options.h" -#include "memory.h" -#include "status.h" -#include "util.h" + #include "packet.h" -#include "iobuf.h" +#include "status.h" #include "exec.h" +#include "keydb.h" +#include "util.h" +#include "i18n.h" +#include "iobuf.h" +#include "memory.h" +#include "options.h" #include "photoid.h" #define PHOTO_COMMAND_MAXLEN 1024 #define DEFAULT_PHOTO_COMMAND "xloadimage -fork -quiet -title 'KeyID 0x%k' stdin" -#define PHOTO_FILENAME_TEMPLATE "gnupg-photo-id-XXXXXX" /* Generate a new photo id packet, or return NULL if canceled */ PKT_user_id *generate_photo_id(PKT_public_key *pk)