From: Alan Coopersmith Date: Wed, 15 Jan 2025 21:17:38 +0000 (-0800) Subject: popt: remove obsolete findme.c & findme.h X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=23d9ead5af0249babf241c5917ea2b22c2754bcb;p=thirdparty%2Frsync.git popt: remove obsolete findme.c & findme.h popt 1.14 merged these into popt.c but the import into rsync missed removing them. Fixes: https://github.com/RsyncProject/rsync/issues/710 Signed-off-by: Alan Coopersmith --- diff --git a/Makefile.in b/Makefile.in index 7c75c261..6340403b 100644 --- a/Makefile.in +++ b/Makefile.in @@ -49,7 +49,7 @@ OBJS2=options.o io.o compat.o hlink.o token.o uidlist.o socket.o hashtable.o \ usage.o fileio.o batch.o clientname.o chmod.o acls.o xattrs.o OBJS3=progress.o pipe.o @MD5_ASM@ @ROLL_SIMD@ @ROLL_ASM@ DAEMON_OBJ = params.o loadparm.o clientserver.o access.o connection.o authenticate.o -popt_OBJS=popt/findme.o popt/popt.o popt/poptconfig.o \ +popt_OBJS= popt/popt.o popt/poptconfig.o \ popt/popthelp.o popt/poptparse.o popt/poptint.o OBJS=$(OBJS1) $(OBJS2) $(OBJS3) $(DAEMON_OBJ) $(LIBOBJ) @BUILD_ZLIB@ @BUILD_POPT@ diff --git a/popt/findme.c b/popt/findme.c deleted file mode 100644 index 406d66b2..00000000 --- a/popt/findme.c +++ /dev/null @@ -1,65 +0,0 @@ -/** \ingroup popt - * \file popt/findme.c - */ - -/* (C) 1998-2002 Red Hat, Inc. -- Licensing details are in the COPYING - file accompanying popt source distributions, available from - ftp://ftp.rpm.org/pub/rpm/dist. */ - -#include "system.h" -#include "findme.h" - -#ifndef HAVE_STRLCPY -size_t strlcpy(char *d, const char *s, size_t bufsize); -#endif - -const char * findProgramPath(const char * argv0) -{ - char * path = getenv("PATH"); - char * pathbuf; - char * start, * chptr; - char * buf; - size_t bufsize; - - if (argv0 == NULL) return NULL; /* XXX can't happen */ - /* If there is a / in the argv[0], it has to be an absolute path */ - if (strchr(argv0, '/')) - return xstrdup(argv0); - - if (path == NULL) return NULL; - - bufsize = strlen(path) + 1; - start = pathbuf = malloc(bufsize); - if (pathbuf == NULL) return NULL; /* XXX can't happen */ - strlcpy(pathbuf, path, bufsize); - bufsize += sizeof "/" - 1 + strlen(argv0); - buf = malloc(bufsize); - if (buf == NULL) { - free(pathbuf); - return NULL; /* XXX can't happen */ - } - - chptr = NULL; - /*@-branchstate@*/ - do { - if ((chptr = strchr(start, ':'))) - *chptr = '\0'; - snprintf(buf, bufsize, "%s/%s", start, argv0); - - if (!access(buf, X_OK)) { - free(pathbuf); - return buf; - } - - if (chptr) - start = chptr + 1; - else - start = NULL; - } while (start && *start); - /*@=branchstate@*/ - - free(pathbuf); - free(buf); - - return NULL; -} diff --git a/popt/findme.h b/popt/findme.h deleted file mode 100644 index a016b867..00000000 --- a/popt/findme.h +++ /dev/null @@ -1,20 +0,0 @@ -/** \ingroup popt - * \file popt/findme.h - */ - -/* (C) 1998-2000 Red Hat, Inc. -- Licensing details are in the COPYING - file accompanying popt source distributions, available from - ftp://ftp.rpm.org/pub/rpm/dist. */ - -#ifndef H_FINDME -#define H_FINDME - -/** - * Return absolute path to executable by searching PATH. - * @param argv0 name of executable - * @return (malloc'd) absolute path to executable (or NULL) - */ -/*@null@*/ const char * findProgramPath(/*@null@*/ const char * argv0) - /*@*/; - -#endif