Fix the `pkg_add relative to .' bug. Thank you, Ville!

Submitted by:	Ville Eerola <ville@vlsi.fi>
This commit is contained in:
Jordan K. Hubbard 1995-10-31 20:30:18 +00:00
parent 45e829f5a5
commit 58a00a4f4c
2 changed files with 7 additions and 5 deletions

View File

@ -1,5 +1,5 @@
#ifndef lint
static const char *rcsid = "$Id: perform.c,v 1.26.2.5 1995/10/23 12:33:38 jkh Exp $";
static const char *rcsid = "$Id: perform.c,v 1.30 1995/10/25 15:37:49 jkh Exp $";
#endif
/*
@ -109,8 +109,10 @@ pkg_do(char *pkg)
else {
if (pkg[0] == '/') /* full pathname? */
strcpy(pkg_fullname, pkg);
else
sprintf(pkg_fullname, "./%s", pkg);
else {
char cwd[FILENAME_MAX];
sprintf(pkg_fullname, "%s/%s", getwd(cwd),pkg);
}
if (!fexists(pkg_fullname)) {
cp = fileFindByPath(NULL, pkg);

View File

@ -1,5 +1,5 @@
#ifndef lint
static const char *rcsid = "$Id: file.c,v 1.10.4.6 1995/10/15 14:08:40 jkh Exp $";
static const char *rcsid = "$Id: file.c,v 1.17 1995/10/25 15:38:32 jkh Exp $";
#endif
/*
@ -335,7 +335,7 @@ fileFindByPath(char *base, char *fname)
char *cp2 = strsep(&cp, ":");
snprintf(tmp, FILENAME_MAX, "%s/%s.tgz", cp2 ? cp2 : cp, fname);
if (fexists(tmp) && isfile(fname))
if (fexists(tmp) && isfile(tmp))
return tmp;
}
return NULL;