mirror of
https://git.FreeBSD.org/src.git
synced 2025-01-18 15:30:21 +00:00
Fix a long-standing bug that broke pkg_info utterly and probably made
pkg_add a little wiggy too.
This commit is contained in:
parent
e8019cb42b
commit
36dc394c61
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=8424
@ -1,5 +1,5 @@
|
||||
#ifndef lint
|
||||
static const char *rcsid = "$Id: file.c,v 1.7 1995/04/22 13:58:42 jkh Exp $";
|
||||
static const char *rcsid = "$Id: file.c,v 1.8 1995/04/26 15:08:20 jkh Exp $";
|
||||
#endif
|
||||
|
||||
/*
|
||||
@ -255,20 +255,19 @@ fileFindByPath(char *fname)
|
||||
static char tmp[FILENAME_MAX];
|
||||
char *cp;
|
||||
|
||||
if (fexists(fname)) {
|
||||
strcpy(tmp, fname);
|
||||
return tmp;
|
||||
}
|
||||
cp = getenv("PKG_PATH");
|
||||
if (!cp)
|
||||
whinge("Warning: PKG_PATH environment variable not set.");
|
||||
tmp[0] = '\0';
|
||||
while (cp) {
|
||||
char *cp2 = strsep(&cp, ":");
|
||||
|
||||
snprintf(tmp, FILENAME_MAX, "%s/%s.tgz", cp2 ? cp2 : cp, fname);
|
||||
if (fexists(tmp))
|
||||
break;
|
||||
else
|
||||
tmp[0] = '\0';
|
||||
return tmp;
|
||||
}
|
||||
return tmp;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
char *
|
||||
|
Loading…
Reference in New Issue
Block a user