diff options
author | jbj <devnull@localhost> | 2001-04-29 01:05:43 +0000 |
---|---|---|
committer | jbj <devnull@localhost> | 2001-04-29 01:05:43 +0000 |
commit | 3b5820c4205e440d9aad5c5d626721ee30b12292 (patch) | |
tree | b1f0a694903aef1dd937539e1b06c8b0947fb67c /lib/fprint.c | |
parent | 6a0524ed57548de92daa4b6cf8ee9d2ab39d7a42 (diff) | |
download | librpm-tizen-3b5820c4205e440d9aad5c5d626721ee30b12292.tar.gz librpm-tizen-3b5820c4205e440d9aad5c5d626721ee30b12292.tar.bz2 librpm-tizen-3b5820c4205e440d9aad5c5d626721ee30b12292.zip |
- globalize _free(3) wrapper in rpmlib.h, consistent usage throughout.
- internalize locale insensitive ctype(3) in rpmio.h
- boring lclint annotations and fiddles.
CVS patchset: 4721
CVS date: 2001/04/29 01:05:43
Diffstat (limited to 'lib/fprint.c')
-rw-r--r-- | lib/fprint.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/lib/fprint.c b/lib/fprint.c index 7fea93442..52f07fd3c 100644 --- a/lib/fprint.c +++ b/lib/fprint.c @@ -114,15 +114,16 @@ static fingerPrint doLookup(fingerPrintCache cache, /* as we're stating paths here, we want to follow symlinks */ - if ((cacheHit = cacheContainsDirectory(cache, *buf ? buf : "/"))) { + cacheHit = cacheContainsDirectory(cache, (*buf != '\0' ? buf : "/")); + if (cacheHit != NULL) { fp.entry = cacheHit; - } else if (!stat(*buf ? buf : "/", &sb)) { - size_t nb = sizeof(*fp.entry) + (*buf ? (end-buf) : 1) + 1; + } else if (!stat((*buf != '\0' ? buf : "/"), &sb)) { + size_t nb = sizeof(*fp.entry) + (*buf != '\0' ? (end-buf) : 1) + 1; char * dn = xmalloc(nb); struct fprintCacheEntry_s * newEntry = (void *)dn; dn += sizeof(*newEntry); - strcpy(dn, (*buf ? buf : "/")); + strcpy(dn, (*buf != '\0' ? buf : "/")); newEntry->ino = sb.st_ino; newEntry->dev = sb.st_dev; newEntry->isFake = 0; @@ -178,7 +179,7 @@ unsigned int fpHashFunction(const void * key) ch = 0; chptr = fp->baseName; - while (*chptr) ch ^= *chptr++; + while (*chptr != '\0') ch ^= *chptr++; hash |= ((unsigned)ch) << 24; hash |= (((((unsigned)fp->entry->dev) >> 8) ^ fp->entry->dev) & 0xFF) << 16; |