summaryrefslogtreecommitdiff
path: root/rpmio/url.c
diff options
context:
space:
mode:
authorjbj <devnull@localhost>2001-06-01 22:00:07 +0000
committerjbj <devnull@localhost>2001-06-01 22:00:07 +0000
commit9e1929c9bb268faad7c8f140161504dbaf7f00f0 (patch)
treea849218d308086c2e1e831122636063a64a19755 /rpmio/url.c
parent3720e702daeefc4fbb8ce0665b8e6019c6e8b216 (diff)
downloadrpm-9e1929c9bb268faad7c8f140161504dbaf7f00f0.tar.gz
rpm-9e1929c9bb268faad7c8f140161504dbaf7f00f0.tar.bz2
rpm-9e1929c9bb268faad7c8f140161504dbaf7f00f0.zip
- fix: lclint fiddles broke uCache initialization (#43139).
CVS patchset: 4829 CVS date: 2001/06/01 22:00:07
Diffstat (limited to 'rpmio/url.c')
-rw-r--r--rpmio/url.c26
1 files changed, 10 insertions, 16 deletions
diff --git a/rpmio/url.c b/rpmio/url.c
index d0b652320..7d101f861 100644
--- a/rpmio/url.c
+++ b/rpmio/url.c
@@ -171,23 +171,18 @@ static void urlFind(/*@null@*/ /*@in@*/ /*@out@*/ urlinfo *uret, int mustAsk)
{
urlinfo u;
int ucx;
- int i;
+ int i = 0;
if (uret == NULL)
return;
- if (uCache == NULL) {
- *uret = NULL;
- return;
- }
-
u = *uret;
URLSANE(u);
ucx = -1;
for (i = 0; i < uCount; i++) {
- urlinfo ou;
- if ((ou = uCache[i]) == NULL) {
+ urlinfo ou = NULL;
+ if (uCache == NULL || (ou = uCache[i]) == NULL) {
if (ucx < 0)
ucx = i;
continue;
@@ -211,12 +206,10 @@ static void urlFind(/*@null@*/ /*@in@*/ /*@out@*/ urlinfo *uret, int mustAsk)
if (i == uCount) {
if (ucx < 0) {
ucx = uCount++;
- if (uCache)
- uCache = xrealloc(uCache, sizeof(*uCache) * uCount);
- else
- uCache = xmalloc(sizeof(*uCache));
+ uCache = xrealloc(uCache, sizeof(*uCache) * uCount);
}
- uCache[ucx] = urlLink(u, "uCache (miss)");
+ if (uCache) /* XXX always true */
+ uCache[ucx] = urlLink(u, "uCache (miss)");
u = urlFree(u, "urlSplit (urlFind miss)");
} else {
ucx = i;
@@ -225,7 +218,8 @@ static void urlFind(/*@null@*/ /*@in@*/ /*@out@*/ urlinfo *uret, int mustAsk)
/* This URL is now cached. */
- u = urlLink(uCache[ucx], "uCache");
+ if (uCache) /* XXX always true */
+ u = urlLink(uCache[ucx], "uCache");
*uret = u;
/*@-usereleased@*/
u = urlFree(u, "uCache (urlFind)");
@@ -239,8 +233,8 @@ static void urlFind(/*@null@*/ /*@in@*/ /*@out@*/ urlinfo *uret, int mustAsk)
if (u->urltype == URL_IS_FTP) {
if (mustAsk || (u->user != NULL && u->password == NULL)) {
- /*@observer@*/ const char * host = (u->host ? u->host : "");
- /*@observer@*/ const char * user = (u->user ? u->user : "");
+ const char * host = (u->host ? u->host : "");
+ const char * user = (u->user ? u->user : "");
char * prompt;
prompt = alloca(strlen(host) + strlen(user) + 256);
sprintf(prompt, _("Password for %s@%s: "), user, host);