Date: Tue, 14 May 2002 16:07:14 +0200 From: Jeremy Lea <reg@FreeBSD.org> To: Maxim Sobolev <sobomax@FreeBSD.org> Cc: "Bruce A. Mah" <bmah@FreeBSD.org>, current@FreeBSD.org, ports@FreeBSD.org Subject: Re: pkg_version in C [was: Re: Perl scripts that need rewriting - Progress!] Message-ID: <20020514160714.D13083@shale.csir.co.za> In-Reply-To: <3CE10EE1.27F9718@FreeBSD.org>; from sobomax@FreeBSD.org on Tue, May 14, 2002 at 04:19:29PM %2B0300 References: <200205091933.g49JXMjV041629@grimreaper.grondar.org> <20020514145039.B13083@shale.csir.co.za> <3CE10EE1.27F9718@FreeBSD.org>
next in thread | previous in thread | raw e-mail | index | archive | help
Hi,
On Tue, May 14, 2002 at 04:19:29PM +0300, Maxim Sobolev wrote:
>
> +++ version/perform.c 14 May 2002 12:41:41 -0000
> [...]
> + strlcpy(tmp, PORTS_DIR, PATH_MAX);
> + strlcat(tmp, "/INDEX", PATH_MAX);
>
> I'd suggest snprintf(3)
Yeah. Like I said, it needs a bit of polishing. I tend to do things
this way while I'm developing because I find it easier to keep track of
what's going where in the string. There's also a bunch of places where
the 'l' versions aren't needed...
> Why noy use matchinstalled() which do something similar?
I looked at it, but it was taking more code to make it work than to
duplicate it because the -s flag is not a regex or a globing pattern.
It's a poorly designed interface... Now that it's working I'll look at
it again and see if I can get it to do the right thing. Simplifying
working code is a lot easier than building it.
> + funny:
> + warnx("This is a very funny looking INDEX!");
> + return 1;
>
> I don't think this is a good choice for an error message.
;-)
Regards,
-Jeremy
--
FreeBSD - Because the best things in life are free...
http://www.freebsd.org/
To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-current" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20020514160714.D13083>
