diff options
author | David Edelsohn <edelsohn@gnu.org> | 1996-02-14 19:35:33 +0000 |
---|---|---|
committer | David Edelsohn <edelsohn@gnu.org> | 1996-02-14 19:35:33 +0000 |
commit | bc9fadfb1c0b1f9a1d4038ddab92a3dda133983a (patch) | |
tree | f45643ea0630ed319960e16e71e8956d5c663845 /gcc | |
parent | e8d791dd5551e3b3458286ab23c8b2d280afc560 (diff) | |
download | gcc-bc9fadfb1c0b1f9a1d4038ddab92a3dda133983a.zip gcc-bc9fadfb1c0b1f9a1d4038ddab92a3dda133983a.tar.gz gcc-bc9fadfb1c0b1f9a1d4038ddab92a3dda133983a.tar.bz2 |
append / to AIX import path if not present
From-SVN: r11275
Diffstat (limited to 'gcc')
-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 f2dd27e..30fb49d 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; } |