diff options
author | jbj <devnull@localhost> | 1999-09-06 20:59:39 +0000 |
---|---|---|
committer | jbj <devnull@localhost> | 1999-09-06 20:59:39 +0000 |
commit | d753cdadf734488f5539a53e3898fd3ebc1a4508 (patch) | |
tree | 01ab000ed6d78ab035b2eaaf55199e735e141c30 /build | |
parent | bc837d1e3f616a7dd2973f25b7ac1d18bfafcb16 (diff) | |
download | librpm-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.c | 9 | ||||
-rw-r--r-- | build/parseSpec.c | 3 |
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; |