Subject: Re: pkg/29152: pkgfind patch for linux and openbsd
To: None <pkg-manager@netbsd.org, gnats-admin@netbsd.org,>
From: Julio M. Merino Vidal <jmmv84@gmail.com>
List: pkgsrc-bugs
Date: 01/30/2005 19:38:01
The following reply was made to PR pkg/29152; it has been noted by GNATS.
From: "Julio M. Merino Vidal" <jmmv84@gmail.com>
To: Peter Postma <peter@pointless.nl>
Cc: Jan Schaumann <jschauma@netmeister.org>, gnats-bugs@netbsd.org
Subject: Re: pkg/29152: pkgfind patch for linux and openbsd
Date: Sun, 30 Jan 2005 20:37:44 +0100
On Sun, 2005-01-30 at 18:53 +0100, Peter Postma wrote:
> Ok, the attached diff should be ok now I think.
> Could you please check it one more time before I commit it?
@@ -73,11 +68,10 @@
int
main(int argc, char *argv[])
{
+ const char *progname = argv[0];
const char *path;
int ch;
- setprogname("pkgfind");
-
/* default searches have partial matches */
search = partialmatch;
I think you could instead do:
if ((progname = strrchr(argv[0], '/')) != NULL)
progname++;
else
progname = argv[0];
to remove any possible directory name from argv[0].
Cheers,
--
Julio M. Merino Vidal <jmmv84@gmail.com>
http://www.livejournal.com/users/jmmv/
The NetBSD Project - http://www.NetBSD.org/