From dad54fe3956428f416606e95b30e759fc73d418d Mon Sep 17 00:00:00 2001 From: root Date: Fri, 16 Feb 1996 17:26:43 +0000 Subject: [PATCH] fix handling of NULL newname/subname in lookup_package() CVS patchset: 299 CVS date: 1996/02/16 17:26:43 --- build/spec.c | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/build/spec.c b/build/spec.c index 3b119ee..7e86206 100644 --- a/build/spec.c +++ b/build/spec.c @@ -240,23 +240,25 @@ int lookup_package(Spec s, struct PackageRec **pr, char *name, int flags) package = s->packages; while (package) { - if (flags & (LP_SUBNAME | LP_NEWNAME)) { - if ((! package->newname) & (! package->subname)) { - package = package->next; - continue; - } - } if (flags & LP_SUBNAME) { + if (! package->subname) { + package = package->next; + continue; + } if (! strcmp(package->subname, name)) { break; } } else if (flags & LP_NEWNAME) { + if (! package->newname) { + package = package->next; + continue; + } if (! strcmp(package->newname, name)) { break; } } else { /* Base package */ - if ((! package->newname) & (! package->subname)) { + if ((! package->newname) && (! package->subname)) { break; } } -- 2.7.4