diff options
author | edelsohn <edelsohn@138bc75d-0d04-0410-961f-82ee72b054a4> | 1996-02-14 19:35:33 +0000 |
---|---|---|
committer | edelsohn <edelsohn@138bc75d-0d04-0410-961f-82ee72b054a4> | 1996-02-14 19:35:33 +0000 |
commit | 560a921e7702d2370ab96025c4c2f383ac277179 (patch) | |
tree | f45643ea0630ed319960e16e71e8956d5c663845 /gcc/collect2.c | |
parent | d74a91f982973b724e77ef75e126b7d871aa7846 (diff) | |
download | gcc-560a921e7702d2370ab96025c4c2f383ac277179.tar.gz |
append / to AIX import path if not present
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@11275 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/collect2.c')
-rw-r--r-- | gcc/collect2.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/gcc/collect2.c b/gcc/collect2.c index f2dd27e2e20..30fb49d8e63 100644 --- a/gcc/collect2.c +++ b/gcc/collect2.c @@ -2616,6 +2616,7 @@ scan_libraries (prog_name) char *impmem = implib + strlen (implib) + 1; char *soname = NULL; char *trial; + int pathlen; LDFILE *libptr = NULL; struct prefix_list *pl; ARCHDR ah; @@ -2627,12 +2628,15 @@ scan_libraries (prog_name) if (*impath == '/' && *(impath+1) == '\0' && strcmp (implib, "unix") == 0) continue; - trial = alloca (MAX (strlen (impath), libpath.max_len) + pathlen = strlen (impath); + trial = alloca (MAX (pathlen + 1, libpath.max_len) + strlen (implib) + 1); if (*impath) { strcpy (trial, impath); - strcat (trial, implib); + if (impath[pathlen - 1] != '/') + trial[pathlen++] = '/'; + strcpy (trial + pathlen, implib); if (access (trial, R_OK) == 0) soname = trial; } |