Changeset 671
- Timestamp:
- Sep 9, 2003, 1:33:26 PM (22 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/emx/src/emxomf/emxomfld.c
-
Property cvs2svn:cvs-rev
changed from
1.27
to1.28
r670 r671 516 516 } 517 517 518 /* finds the full path of a library or object file.518 /* Finds the full path of a library or object file. 519 519 520 520 Object files and libraries will be searched for using the LIB env.var … … 529 529 if one without the 'lib' prefix was not found. The '.o' and '.a' 530 530 extensions are tried in the last case since otherwise we can find 531 a 'something.a' when 'libsomething.lib' is available. 532 */ 531 a 'something.a' when 'libsomething.lib' is available. */ 533 532 534 533 static FILE *find_objlib (char *fullname, const char *name, int is_library) … … 537 536 FILE *f; 538 537 size_t pathlen, namelen = strlen (name); 539 c har *libpath, *x;538 const char *libpath, *x; 540 539 int i, has_ext = 0, has_path; 541 540 … … 553 552 if (x) 554 553 for (i = 0; i < 2; i++) 555 if ( strcmp (x, exts [is_library][i]) == 0)554 if (!stricmp (x, exts [is_library][i])) 556 555 { 557 556 has_ext = 1; … … 564 563 libpath = getenv ("LIB"); 565 564 pathlen = 0; 565 if (!has_path) 566 { 567 memcpy(fullname, ".\\", 2); 568 pathlen = 2; 569 } 566 570 do 567 571 { … … 575 579 char *cur = fullname + pathlen; 576 580 577 if ((i & 1) && !is_library)581 if ((i & 1) && (!is_library || has_path)) 578 582 continue; 579 583 … … 601 605 else 602 606 { 603 /* Replace forward slashes with backslashes 604 since Knut likes them :) */ 607 /* Replace forward slashes with backslashes (link386). */ 605 608 while ((fullname = strchr (fullname, '/')) != NULL) 606 609 *fullname++ = '\\'; … … 613 616 break; 614 617 615 /* Find where next LIB component ends */ 616 x = strchr (libpath, ';'); 617 if (!x) x = strchr (libpath, 0); 618 pathlen = x - libpath; 619 620 if (pathlen) 621 { 622 memcpy (fullname, libpath, pathlen); 623 /* Append last slash if it is not there */ 624 if (fullname [pathlen - 1] != '/' 625 && fullname [pathlen - 1] != '\\') 626 fullname [pathlen++] = '\\'; 627 } 628 629 /* Advance past ';' in LIB */ 630 libpath = x + 1; 631 } while (*x); 618 /* Find the next LIB component. 619 We're skipping empty components. */ 620 for (;;) 621 { 622 x = strchr (libpath, ';'); 623 if (!x) x = strchr (libpath, 0); 624 pathlen = x - libpath; 625 if (pathlen) 626 { 627 memcpy (fullname, libpath, pathlen); 628 libpath = x + (*x == ';'); 629 /* Append last slash if it is not there */ 630 if (fullname [pathlen - 1] != '/' 631 && fullname [pathlen - 1] != '\\') 632 fullname [pathlen++] = '\\'; 633 break; 634 } 635 if (!*x) 636 break; 637 libpath = x + (*x == ';'); 638 } 639 } while (pathlen); 632 640 633 641 return NULL; -
Property cvs2svn:cvs-rev
changed from
Note:
See TracChangeset
for help on using the changeset viewer.