|
Lines 137-145
Link Here
|
| 137 |
/* It's not an ininstalled package, try and find it among the installed */ |
137 |
/* It's not an ininstalled package, try and find it among the installed */ |
| 138 |
else { |
138 |
else { |
| 139 |
char *tmp; |
139 |
char *tmp; |
|
|
140 |
extern Boolean FuzzySearch; |
| 140 |
|
141 |
|
| 141 |
sprintf(log_dir, "%s/%s", (tmp = getenv(PKG_DBDIR)) ? tmp : DEF_LOG_DIR, |
142 |
tmp = getenv(PKG_DBDIR) ? tmp : DEF_LOG_DIR; |
| 142 |
pkg); |
143 |
sprintf(log_dir, "%s/%s", tmp, pkg); |
|
|
144 |
if (FuzzySearch==TRUE) { |
| 145 |
DIR *dirp=opendir(tmp); |
| 146 |
struct dirent *dp; |
| 147 |
|
| 148 |
while ((dp = readdir(dirp)) != NULL) |
| 149 |
if (strncmp(dp->d_name, pkg, strlen(pkg))==0) |
| 150 |
break; |
| 151 |
closedir(dirp); |
| 152 |
|
| 153 |
if (dp==NULL) { |
| 154 |
warnx("can't find a package prefixed with `%s'!", pkg); |
| 155 |
return 1; |
| 156 |
} |
| 157 |
sprintf(log_dir, "%s/%s", tmp, dp->d_name); |
| 158 |
pkg=dp->d_name; |
| 159 |
} |
| 160 |
|
| 143 |
if (!fexists(log_dir)) { |
161 |
if (!fexists(log_dir)) { |
| 144 |
warnx("can't find package `%s' installed or in a file!", pkg); |
162 |
warnx("can't find package `%s' installed or in a file!", pkg); |
| 145 |
return 1; |
163 |
return 1; |