]> git.ipfire.org Git - thirdparty/rsync.git/commitdiff
popt: remove obsolete findme.c & findme.h
authorAlan Coopersmith <alan.coopersmith@oracle.com>
Wed, 15 Jan 2025 21:17:38 +0000 (13:17 -0800)
committerAndrew Tridgell <andrew@tridgell.net>
Thu, 16 Jan 2025 21:31:36 +0000 (08:31 +1100)
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 <alan.coopersmith@oracle.com>
Makefile.in
popt/findme.c [deleted file]
popt/findme.h [deleted file]

index 7c75c26176df53745a5c23b212bbc43761e44d28..6340403becd127330be5109bcbfb96d7dd2e5927 100644 (file)
@@ -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 (file)
index 406d66b..0000000
+++ /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 (file)
index a016b86..0000000
+++ /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