[Rpm-maint] [PATCH 01/19] Execute matchpathcon_init in a chroot

Steve Lawrence slawrence at tresys.com
Fri Feb 12 20:19:16 UTC 2010


On Fri, 2010-02-05 at 12:26 -0500, James Antill wrote:
> On Tue, 2010-02-02 at 15:25 -0500, Steve Lawrence wrote:
> > +       const char * rootDir = rpmtsRootDir(ts);
> > +       int dochroot = (rootDir != NULL && !rstreq(rootDir, "/") && *rootDir == '/');
> > +       if (dochroot) {
> 
>  Wouldn't this be better as:
> 
> int dochroot = (rootDir != NULL && rootDir[0] == '/' && rootDir[1]);

This was copied form lib/transaction.c. When possible, we try to do
things the way rpm already does them to maintain consistency. But I
agree, the latter is a bit more clear.


More information about the Rpm-maint mailing list