summaryrefslogtreecommitdiff
path: root/build
diff options
context:
space:
mode:
authorjbj <devnull@localhost>1999-09-06 20:59:39 +0000
committerjbj <devnull@localhost>1999-09-06 20:59:39 +0000
commitd753cdadf734488f5539a53e3898fd3ebc1a4508 (patch)
tree01ab000ed6d78ab035b2eaaf55199e735e141c30 /build
parentbc837d1e3f616a7dd2973f25b7ac1d18bfafcb16 (diff)
downloadlibrpm-tizen-d753cdadf734488f5539a53e3898fd3ebc1a4508.tar.gz
librpm-tizen-d753cdadf734488f5539a53e3898fd3ebc1a4508.tar.bz2
librpm-tizen-d753cdadf734488f5539a53e3898fd3ebc1a4508.zip
fix: don't successfully match with strncasecmp("sparc", "sparc64", 5)
CVS patchset: 3259 CVS date: 1999/09/06 20:59:39
Diffstat (limited to 'build')
-rw-r--r--build/files.c9
-rw-r--r--build/parseSpec.c3
2 files changed, 5 insertions, 7 deletions
diff --git a/build/files.c b/build/files.c
index aef226504..e9b78bff2 100644
--- a/build/files.c
+++ b/build/files.c
@@ -710,14 +710,11 @@ static int parseForSimple(Spec spec, Package pkg, char *buf,
res = 1;
} else {
/* XXX WATCHOUT: buf is an arg */
- { const char *ddir, *name, *version;
+ { const char *ddir, *n, *v;
- headerGetEntry(pkg->header, RPMTAG_NAME, NULL,
- (void **) &name, NULL);
- headerGetEntry(pkg->header, RPMTAG_VERSION, NULL,
- (void **) &version, NULL);
+ headerNVR(pkg->header, &n, &v, NULL);
- ddir = rpmGetPath("%{_docdir}/", name, "-", version, NULL);
+ ddir = rpmGetPath("%{_docdir}/", n, "-", v, NULL);
strcpy(buf, ddir);
xfree(ddir);
}
diff --git a/build/parseSpec.c b/build/parseSpec.c
index 6eb55b4bf..5fa216e5f 100644
--- a/build/parseSpec.c
+++ b/build/parseSpec.c
@@ -60,6 +60,7 @@ int isPart(char *line)
static int matchTok(const char *token, const char *line)
{
const char *b, *be = line;
+ size_t toklen = strlen(token);
int rc = 0;
while ( *(b = be) ) {
@@ -73,7 +74,7 @@ static int matchTok(const char *token, const char *line)
* XXX os-from-uname (e.g. "Linux") is compatible with the new
* XXX os-from-platform (e.g "linux" from "sparc-*-linux").
*/
- if (strncasecmp(token, b, (be-b)))
+ if (toklen != (be-b) || strncasecmp(token, b, (be-b)))
continue;
rc = 1;
break;