| 1 |
|
|---|
| 2 |
|
|---|
| 3 |
|
|---|
| 4 |
|
|---|
| 5 |
|
|---|
| 6 |
|
|---|
| 7 |
|
|---|
| 8 |
|
|---|
| 9 |
|
|---|
| 10 |
|
|---|
| 11 |
|
|---|
| 12 |
|
|---|
| 13 |
|
|---|
| 14 |
|
|---|
| 15 |
|
|---|
| 16 |
|
|---|
| 17 |
|
|---|
| 18 |
|
|---|
| 19 |
#include "make.h" |
|---|
| 20 |
#include "filedef.h" |
|---|
| 21 |
#include "variable.h" |
|---|
| 22 |
#ifdef WINDOWS32 |
|---|
| 23 |
#include "pathstuff.h" |
|---|
| 24 |
#endif |
|---|
| 25 |
|
|---|
| 26 |
|
|---|
| 27 |
|
|---|
| 28 |
|
|---|
| 29 |
struct vpath |
|---|
| 30 |
{ |
|---|
| 31 |
struct vpath *next; |
|---|
| 32 |
char *pattern; |
|---|
| 33 |
char *percent; |
|---|
| 34 |
unsigned int patlen; |
|---|
| 35 |
char **searchpath; |
|---|
| 36 |
unsigned int maxlen; |
|---|
| 37 |
}; |
|---|
| 38 |
|
|---|
| 39 |
|
|---|
| 40 |
|
|---|
| 41 |
static struct vpath *vpaths; |
|---|
| 42 |
|
|---|
| 43 |
|
|---|
| 44 |
|
|---|
| 45 |
static struct vpath *general_vpath; |
|---|
| 46 |
|
|---|
| 47 |
|
|---|
| 48 |
|
|---|
| 49 |
static struct vpath *gpaths; |
|---|
| 50 |
|
|---|
| 51 |
static int selective_vpath_search PARAMS ((struct vpath *path, char **file, FILE_TIMESTAMP *mtime_ptr)); |
|---|
| 52 |
|
|---|
| 53 |
|
|---|
| 54 |
|
|---|
| 55 |
|
|---|
| 56 |
|
|---|
| 57 |
void |
|---|
| 58 |
build_vpath_lists () |
|---|
| 59 |
{ |
|---|
| 60 |
register struct vpath *new = 0; |
|---|
| 61 |
register struct vpath *old, *nexto; |
|---|
| 62 |
register char *p; |
|---|
| 63 |
|
|---|
| 64 |
|
|---|
| 65 |
for (old = vpaths; old != 0; old = nexto) |
|---|
| 66 |
{ |
|---|
| 67 |
nexto = old->next; |
|---|
| 68 |
old->next = new; |
|---|
| 69 |
new = old; |
|---|
| 70 |
} |
|---|
| 71 |
|
|---|
| 72 |
vpaths = new; |
|---|
| 73 |
|
|---|
| 74 |
|
|---|
| 75 |
|
|---|
| 76 |
|
|---|
| 77 |
|
|---|
| 78 |
{ |
|---|
| 79 |
|
|---|
| 80 |
int save = warn_undefined_variables_flag; |
|---|
| 81 |
warn_undefined_variables_flag = 0; |
|---|
| 82 |
|
|---|
| 83 |
p = variable_expand ("$(strip $(VPATH))"); |
|---|
| 84 |
|
|---|
| 85 |
warn_undefined_variables_flag = save; |
|---|
| 86 |
} |
|---|
| 87 |
|
|---|
| 88 |
if (*p != '\0') |
|---|
| 89 |
{ |
|---|
| 90 |
|
|---|
| 91 |
struct vpath *save_vpaths = vpaths; |
|---|
| 92 |
|
|---|
| 93 |
|
|---|
| 94 |
|
|---|
| 95 |
vpaths = 0; |
|---|
| 96 |
|
|---|
| 97 |
|
|---|
| 98 |
construct_vpath_list ("%", p); |
|---|
| 99 |
|
|---|
| 100 |
|
|---|
| 101 |
|
|---|
| 102 |
general_vpath = vpaths; |
|---|
| 103 |
vpaths = save_vpaths; |
|---|
| 104 |
} |
|---|
| 105 |
|
|---|
| 106 |
|
|---|
| 107 |
|
|---|
| 108 |
|
|---|
| 109 |
|
|---|
| 110 |
{ |
|---|
| 111 |
|
|---|
| 112 |
int save = warn_undefined_variables_flag; |
|---|
| 113 |
warn_undefined_variables_flag = 0; |
|---|
| 114 |
|
|---|
| 115 |
p = variable_expand ("$(strip $(GPATH))"); |
|---|
| 116 |
|
|---|
| 117 |
warn_undefined_variables_flag = save; |
|---|
| 118 |
} |
|---|
| 119 |
|
|---|
| 120 |
if (*p != '\0') |
|---|
| 121 |
{ |
|---|
| 122 |
|
|---|
| 123 |
struct vpath *save_vpaths = vpaths; |
|---|
| 124 |
|
|---|
| 125 |
|
|---|
| 126 |
|
|---|
| 127 |
vpaths = 0; |
|---|
| 128 |
|
|---|
| 129 |
|
|---|
| 130 |
construct_vpath_list ("%", p); |
|---|
| 131 |
|
|---|
| 132 |
|
|---|
| 133 |
|
|---|
| 134 |
gpaths = vpaths; |
|---|
| 135 |
vpaths = save_vpaths; |
|---|
| 136 |
} |
|---|
| 137 |
} |
|---|
| 138 |
|
|---|
| 139 |
|
|---|
| 140 |
|
|---|
| 141 |
|
|---|
| 142 |
|
|---|
| 143 |
|
|---|
| 144 |
|
|---|
| 145 |
|
|---|
| 146 |
|
|---|
| 147 |
|
|---|
| 148 |
|
|---|
| 149 |
|
|---|
| 150 |
|
|---|
| 151 |
|
|---|
| 152 |
|
|---|
| 153 |
|
|---|
| 154 |
|
|---|
| 155 |
|
|---|
| 156 |
|
|---|
| 157 |
|
|---|
| 158 |
void |
|---|
| 159 |
construct_vpath_list (char *pattern, char *dirpath) |
|---|
| 160 |
{ |
|---|
| 161 |
register unsigned int elem; |
|---|
| 162 |
register char *p; |
|---|
| 163 |
register char **vpath; |
|---|
| 164 |
register unsigned int maxvpath; |
|---|
| 165 |
unsigned int maxelem; |
|---|
| 166 |
char *percent = NULL; |
|---|
| 167 |
|
|---|
| 168 |
if (pattern != 0) |
|---|
| 169 |
{ |
|---|
| 170 |
pattern = xstrdup (pattern); |
|---|
| 171 |
percent = find_percent (pattern); |
|---|
| 172 |
} |
|---|
| 173 |
|
|---|
| 174 |
if (dirpath == 0) |
|---|
| 175 |
{ |
|---|
| 176 |
|
|---|
| 177 |
register struct vpath *path, *lastpath; |
|---|
| 178 |
|
|---|
| 179 |
lastpath = 0; |
|---|
| 180 |
path = vpaths; |
|---|
| 181 |
while (path != 0) |
|---|
| 182 |
{ |
|---|
| 183 |
struct vpath *next = path->next; |
|---|
| 184 |
|
|---|
| 185 |
if (pattern == 0 |
|---|
| 186 |
|| (((percent == 0 && path->percent == 0) |
|---|
| 187 |
|| (percent - pattern == path->percent - path->pattern)) |
|---|
| 188 |
&& streq (pattern, path->pattern))) |
|---|
| 189 |
{ |
|---|
| 190 |
|
|---|
| 191 |
if (lastpath == 0) |
|---|
| 192 |
vpaths = path->next; |
|---|
| 193 |
else |
|---|
| 194 |
lastpath->next = next; |
|---|
| 195 |
|
|---|
| 196 |
|
|---|
| 197 |
free (path->pattern); |
|---|
| 198 |
free ((char *) path->searchpath); |
|---|
| 199 |
free ((char *) path); |
|---|
| 200 |
} |
|---|
| 201 |
else |
|---|
| 202 |
lastpath = path; |
|---|
| 203 |
|
|---|
| 204 |
path = next; |
|---|
| 205 |
} |
|---|
| 206 |
|
|---|
| 207 |
if (pattern != 0) |
|---|
| 208 |
free (pattern); |
|---|
| 209 |
return; |
|---|
| 210 |
} |
|---|
| 211 |
|
|---|
| 212 |
#ifdef WINDOWS32 |
|---|
| 213 |
convert_vpath_to_windows32(dirpath, ';'); |
|---|
| 214 |
#endif |
|---|
| 215 |
|
|---|
| 216 |
|
|---|
| 217 |
|
|---|
| 218 |
|
|---|
| 219 |
|
|---|
| 220 |
maxelem = 2; |
|---|
| 221 |
p = dirpath; |
|---|
| 222 |
while (*p != '\0') |
|---|
| 223 |
if (*p++ == PATH_SEPARATOR_CHAR || isblank ((unsigned char)*p)) |
|---|
| 224 |
++maxelem; |
|---|
| 225 |
|
|---|
| 226 |
vpath = (char **) xmalloc (maxelem * sizeof (char *)); |
|---|
| 227 |
maxvpath = 0; |
|---|
| 228 |
|
|---|
| 229 |
|
|---|
| 230 |
p = dirpath; |
|---|
| 231 |
while (*p == PATH_SEPARATOR_CHAR || isblank ((unsigned char)*p)) |
|---|
| 232 |
++p; |
|---|
| 233 |
|
|---|
| 234 |
elem = 0; |
|---|
| 235 |
while (*p != '\0') |
|---|
| 236 |
{ |
|---|
| 237 |
char *v; |
|---|
| 238 |
unsigned int len; |
|---|
| 239 |
|
|---|
| 240 |
|
|---|
| 241 |
v = p; |
|---|
| 242 |
while (*p != '\0' && *p != PATH_SEPARATOR_CHAR |
|---|
| 243 |
&& !isblank ((unsigned char)*p)) |
|---|
| 244 |
++p; |
|---|
| 245 |
|
|---|
| 246 |
len = p - v; |
|---|
| 247 |
|
|---|
| 248 |
|
|---|
| 249 |
#if defined(__MSDOS__) || defined(__EMX__) |
|---|
| 250 |
|
|---|
| 251 |
if (len > 3 || (len > 1 && v[1] != ':')) |
|---|
| 252 |
#endif |
|---|
| 253 |
if (len > 1 && p[-1] == '/') |
|---|
| 254 |
--len; |
|---|
| 255 |
|
|---|
| 256 |
if (len > 1 || *v != '.') |
|---|
| 257 |
{ |
|---|
| 258 |
v = savestring (v, len); |
|---|
| 259 |
|
|---|
| 260 |
|
|---|
| 261 |
|
|---|
| 262 |
if (dir_file_exists_p (v, "")) |
|---|
| 263 |
{ |
|---|
| 264 |
|
|---|
| 265 |
vpath[elem++] = dir_name (v); |
|---|
| 266 |
free (v); |
|---|
| 267 |
if (len > maxvpath) |
|---|
| 268 |
maxvpath = len; |
|---|
| 269 |
} |
|---|
| 270 |
else |
|---|
| 271 |
|
|---|
| 272 |
free (v); |
|---|
| 273 |
} |
|---|
| 274 |
|
|---|
| 275 |
|
|---|
| 276 |
while (*p == PATH_SEPARATOR_CHAR || isblank ((unsigned char)*p)) |
|---|
| 277 |
++p; |
|---|
| 278 |
} |
|---|
| 279 |
|
|---|
| 280 |
if (elem > 0) |
|---|
| 281 |
{ |
|---|
| 282 |
struct vpath *path; |
|---|
| 283 |
|
|---|
| 284 |
|
|---|
| 285 |
|
|---|
| 286 |
if (elem < (maxelem - 1)) |
|---|
| 287 |
vpath = (char **) xrealloc ((char *) vpath, |
|---|
| 288 |
(elem + 1) * sizeof (char *)); |
|---|
| 289 |
|
|---|
| 290 |
|
|---|
| 291 |
vpath[elem] = 0; |
|---|
| 292 |
|
|---|
| 293 |
|
|---|
| 294 |
path = (struct vpath *) xmalloc (sizeof (struct vpath)); |
|---|
| 295 |
path->searchpath = vpath; |
|---|
| 296 |
path->maxlen = maxvpath; |
|---|
| 297 |
path->next = vpaths; |
|---|
| 298 |
vpaths = path; |
|---|
| 299 |
|
|---|
| 300 |
|
|---|
| 301 |
path->pattern = pattern; |
|---|
| 302 |
path->percent = percent; |
|---|
| 303 |
path->patlen = strlen (pattern); |
|---|
| 304 |
} |
|---|
| 305 |
else |
|---|
| 306 |
{ |
|---|
| 307 |
|
|---|
| 308 |
free ((char *) vpath); |
|---|
| 309 |
if (pattern != 0) |
|---|
| 310 |
free (pattern); |
|---|
| 311 |
} |
|---|
| 312 |
} |
|---|
| 313 |
|
|---|
| 314 |
|
|---|
| 315 |
|
|---|
| 316 |
|
|---|
| 317 |
int |
|---|
| 318 |
gpath_search (char *file, unsigned int len) |
|---|
| 319 |
{ |
|---|
| 320 |
char **gp; |
|---|
| 321 |
|
|---|
| 322 |
if (gpaths && (len <= gpaths->maxlen)) |
|---|
| 323 |
for (gp = gpaths->searchpath; *gp != NULL; ++gp) |
|---|
| 324 |
if (strneq (*gp, file, len) && (*gp)[len] == '\0') |
|---|
| 325 |
return 1; |
|---|
| 326 |
|
|---|
| 327 |
return 0; |
|---|
| 328 |
} |
|---|
| 329 |
|
|---|
| 330 |
|
|---|
| 331 |
|
|---|
| 332 |
|
|---|
| 333 |
|
|---|
| 334 |
|
|---|
| 335 |
|
|---|
| 336 |
int |
|---|
| 337 |
vpath_search (char **file, FILE_TIMESTAMP *mtime_ptr) |
|---|
| 338 |
{ |
|---|
| 339 |
register struct vpath *v; |
|---|
| 340 |
|
|---|
| 341 |
|
|---|
| 342 |
|
|---|
| 343 |
|
|---|
| 344 |
if (**file == '/' |
|---|
| 345 |
#ifdef HAVE_DOS_PATHS |
|---|
| 346 |
|| **file == '\\' |
|---|
| 347 |
|| (*file)[1] == ':' |
|---|
| 348 |
#endif |
|---|
| 349 |
|| (vpaths == 0 && general_vpath == 0)) |
|---|
| 350 |
return 0; |
|---|
| 351 |
|
|---|
| 352 |
for (v = vpaths; v != 0; v = v->next) |
|---|
| 353 |
if (pattern_matches (v->pattern, v->percent, *file)) |
|---|
| 354 |
if (selective_vpath_search (v, file, mtime_ptr)) |
|---|
| 355 |
return 1; |
|---|
| 356 |
|
|---|
| 357 |
if (general_vpath != 0 |
|---|
| 358 |
&& selective_vpath_search (general_vpath, file, mtime_ptr)) |
|---|
| 359 |
return 1; |
|---|
| 360 |
|
|---|
| 361 |
return 0; |
|---|
| 362 |
} |
|---|
| 363 |
|
|---|
| 364 |
|
|---|
| 365 |
|
|---|
| 366 |
|
|---|
| 367 |
|
|---|
| 368 |
|
|---|
| 369 |
|
|---|
| 370 |
|
|---|
| 371 |
static int |
|---|
| 372 |
selective_vpath_search (struct vpath *path, char **file, |
|---|
| 373 |
FILE_TIMESTAMP *mtime_ptr) |
|---|
| 374 |
{ |
|---|
| 375 |
int not_target; |
|---|
| 376 |
char *name, *n; |
|---|
| 377 |
char *filename; |
|---|
| 378 |
register char **vpath = path->searchpath; |
|---|
| 379 |
unsigned int maxvpath = path->maxlen; |
|---|
| 380 |
register unsigned int i; |
|---|
| 381 |
unsigned int flen, vlen, name_dplen; |
|---|
| 382 |
int exists = 0; |
|---|
| 383 |
|
|---|
| 384 |
|
|---|
| 385 |
|
|---|
| 386 |
|
|---|
| 387 |
{ |
|---|
| 388 |
struct file *f = lookup_file (*file); |
|---|
| 389 |
not_target = f == 0 || !f->is_target; |
|---|
| 390 |
} |
|---|
| 391 |
|
|---|
| 392 |
flen = strlen (*file); |
|---|
| 393 |
|
|---|
| 394 |
|
|---|
| 395 |
|
|---|
| 396 |
|
|---|
| 397 |
|
|---|
| 398 |
n = strrchr (*file, '/'); |
|---|
| 399 |
#ifdef HAVE_DOS_PATHS |
|---|
| 400 |
|
|---|
| 401 |
{ |
|---|
| 402 |
char *bslash = strrchr(*file, '\\'); |
|---|
| 403 |
if (!n || bslash > n) |
|---|
| 404 |
n = bslash; |
|---|
| 405 |
} |
|---|
| 406 |
#endif |
|---|
| 407 |
name_dplen = n != 0 ? n - *file : 0; |
|---|
| 408 |
filename = name_dplen > 0 ? n + 1 : *file; |
|---|
| 409 |
if (name_dplen > 0) |
|---|
| 410 |
flen -= name_dplen + 1; |
|---|
| 411 |
|
|---|
| 412 |
|
|---|
| 413 |
|
|---|
| 414 |
|
|---|
| 415 |
|
|---|
| 416 |
name = (char *) xmalloc (maxvpath + 1 + name_dplen + 1 + flen + 1); |
|---|
| 417 |
|
|---|
| 418 |
|
|---|
| 419 |
for (i = 0; vpath[i] != 0; ++i) |
|---|
| 420 |
{ |
|---|
| 421 |
int exists_in_cache = 0; |
|---|
| 422 |
|
|---|
| 423 |
n = name; |
|---|
| 424 |
|
|---|
| 425 |
|
|---|
| 426 |
vlen = strlen (vpath[i]); |
|---|
| 427 |
bcopy (vpath[i], n, vlen); |
|---|
| 428 |
n += vlen; |
|---|
| 429 |
|
|---|
| 430 |
|
|---|
| 431 |
if (name_dplen > 0) |
|---|
| 432 |
{ |
|---|
| 433 |
#ifndef VMS |
|---|
| 434 |
*n++ = '/'; |
|---|
| 435 |
#endif |
|---|
| 436 |
bcopy (*file, n, name_dplen); |
|---|
| 437 |
n += name_dplen; |
|---|
| 438 |
} |
|---|
| 439 |
|
|---|
| 440 |
#ifdef HAVE_DOS_PATHS |
|---|
| 441 |
|
|---|
| 442 |
if (n != name && n[-1] == '\\' ) |
|---|
| 443 |
n[-1] = '/'; |
|---|
| 444 |
#endif |
|---|
| 445 |
|
|---|
| 446 |
#ifndef VMS |
|---|
| 447 |
if (n != name && n[-1] != '/') |
|---|
| 448 |
{ |
|---|
| 449 |
*n = '/'; |
|---|
| 450 |
bcopy (filename, n + 1, flen + 1); |
|---|
| 451 |
} |
|---|
| 452 |
else |
|---|
| 453 |
#endif |
|---|
| 454 |
bcopy (filename, n, flen + 1); |
|---|
| 455 |
|
|---|
| 456 |
|
|---|
| 457 |
|
|---|
| 458 |
|
|---|
| 459 |
|
|---|
| 460 |
|
|---|
| 461 |
|
|---|
| 462 |
|
|---|
| 463 |
|
|---|
| 464 |
|
|---|
| 465 |
|
|---|
| 466 |
|
|---|
| 467 |
|
|---|
| 468 |
|
|---|
| 469 |
|
|---|
| 470 |
|
|---|
| 471 |
|
|---|
| 472 |
|
|---|
| 473 |
|
|---|
| 474 |
|
|---|
| 475 |
|
|---|
| 476 |
|
|---|
| 477 |
{ |
|---|
| 478 |
struct file *f = lookup_file (name); |
|---|
| 479 |
if (f != 0) |
|---|
| 480 |
{ |
|---|
| 481 |
exists = not_target || f->is_target; |
|---|
| 482 |
if (exists && mtime_ptr |
|---|
| 483 |
&& (f->last_mtime == OLD_MTIME || f->last_mtime == NEW_MTIME)) |
|---|
| 484 |
{ |
|---|
| 485 |
*mtime_ptr = f->last_mtime; |
|---|
| 486 |
mtime_ptr = 0; |
|---|
| 487 |
} |
|---|
| 488 |
} |
|---|
| 489 |
} |
|---|
| 490 |
|
|---|
| 491 |
if (!exists) |
|---|
| 492 |
{ |
|---|
| 493 |
|
|---|
| 494 |
|
|---|
| 495 |
|
|---|
| 496 |
#ifdef VMS |
|---|
| 497 |
exists_in_cache = exists = dir_file_exists_p (vpath[i], filename); |
|---|
| 498 |
#else |
|---|
| 499 |
|
|---|
| 500 |
|
|---|
| 501 |
*n = '\0'; |
|---|
| 502 |
|
|---|
| 503 |
|
|---|
| 504 |
|
|---|
| 505 |
|
|---|
| 506 |
exists_in_cache = exists = dir_file_exists_p (name, filename); |
|---|
| 507 |
#endif |
|---|
| 508 |
} |
|---|
| 509 |
|
|---|
| 510 |
if (exists) |
|---|
| 511 |
{ |
|---|
| 512 |
|
|---|
| 513 |
|
|---|
| 514 |
|
|---|
| 515 |
|
|---|
| 516 |
|
|---|
| 517 |
|
|---|
| 518 |
struct stat st; |
|---|
| 519 |
|
|---|
| 520 |
#ifndef VMS |
|---|
| 521 |
|
|---|
| 522 |
*n = '/'; |
|---|
| 523 |
#endif |
|---|
| 524 |
|
|---|
| 525 |
if (exists_in_cache) |
|---|
| 526 |
{ |
|---|
| 527 |
int e; |
|---|
| 528 |
|
|---|
| 529 |
EINTRLOOP (e, stat (name, &st)); |
|---|
| 530 |
if (e != 0) |
|---|
| 531 |
{ |
|---|
| 532 |
exists = 0; |
|---|
| 533 |
continue; |
|---|
| 534 |
} |
|---|
| 535 |
|
|---|
| 536 |
|
|---|
| 537 |
if (mtime_ptr != 0) |
|---|
| 538 |
{ |
|---|
| 539 |
*mtime_ptr = FILE_TIMESTAMP_STAT_MODTIME (name, st); |
|---|
| 540 |
mtime_ptr = 0; |
|---|
| 541 |
} |
|---|
| 542 |
} |
|---|
| 543 |
|
|---|
| 544 |
|
|---|
| 545 |
|
|---|
| 546 |
|
|---|
| 547 |
*file = savestring (name, (n + 1 - name) + flen); |
|---|
| 548 |
|
|---|
| 549 |
|
|---|
| 550 |
|
|---|
| 551 |
if (mtime_ptr != 0) |
|---|
| 552 |
*mtime_ptr = UNKNOWN_MTIME; |
|---|
| 553 |
|
|---|
| 554 |
free (name); |
|---|
| 555 |
return 1; |
|---|
| 556 |
} |
|---|
| 557 |
} |
|---|
| 558 |
|
|---|
| 559 |
free (name); |
|---|
| 560 |
return 0; |
|---|
| 561 |
} |
|---|
| 562 |
|
|---|
| 563 |
|
|---|
| 564 |
|
|---|
| 565 |
void |
|---|
| 566 |
print_vpath_data_base (void) |
|---|
| 567 |
{ |
|---|
| 568 |
register unsigned int nvpaths; |
|---|
| 569 |
register struct vpath *v; |
|---|
| 570 |
|
|---|
| 571 |
puts (_("\n# VPATH Search Paths\n")); |
|---|
| 572 |
|
|---|
| 573 |
nvpaths = 0; |
|---|
| 574 |
for (v = vpaths; v != 0; v = v->next) |
|---|
| 575 |
{ |
|---|
| 576 |
register unsigned int i; |
|---|
| 577 |
|
|---|
| 578 |
++nvpaths; |
|---|
| 579 |
|
|---|
| 580 |
printf ("vpath %s ", v->pattern); |
|---|
| 581 |
|
|---|
| 582 |
for (i = 0; v->searchpath[i] != 0; ++i) |
|---|
| 583 |
printf ("%s%c", v->searchpath[i], |
|---|
| 584 |
v->searchpath[i + 1] == 0 ? '\n' : PATH_SEPARATOR_CHAR); |
|---|
| 585 |
} |
|---|
| 586 |
|
|---|
| 587 |
if (vpaths == 0) |
|---|
| 588 |
puts (_("# No `vpath' search paths.")); |
|---|
| 589 |
else |
|---|
| 590 |
printf (_("\n# %u `vpath' search paths.\n"), nvpaths); |
|---|
| 591 |
|
|---|
| 592 |
if (general_vpath == 0) |
|---|
| 593 |
puts (_("\n# No general (`VPATH' variable) search path.")); |
|---|
| 594 |
else |
|---|
| 595 |
{ |
|---|
| 596 |
register char **path = general_vpath->searchpath; |
|---|
| 597 |
register unsigned int i; |
|---|
| 598 |
|
|---|
| 599 |
fputs (_("\n# General (`VPATH' variable) search path:\n# "), stdout); |
|---|
| 600 |
|
|---|
| 601 |
for (i = 0; path[i] != 0; ++i) |
|---|
| 602 |
printf ("%s%c", path[i], |
|---|
| 603 |
path[i + 1] == 0 ? '\n' : PATH_SEPARATOR_CHAR); |
|---|
| 604 |
} |
|---|
| 605 |
} |
|---|