GCC Bugzilla – Attachment 17181 Details for
Bug 38966
libiberty make_relative_prefix_1 mistakes directories for executables
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Proposed fix for make_relative_prefix_1
libiberty.diff (text/plain), 1.06 KB, created by
Michael Lotz
on 2009-01-25 14:56:28 UTC
(
hide
)
Description:
Proposed fix for make_relative_prefix_1
Filename:
MIME Type:
Creator:
Michael Lotz
Created:
2009-01-25 14:56:28 UTC
Size:
1.06 KB
patch
obsolete
>diff -urN gcc-4.3.2-clean/libiberty/make-relative-prefix.c gcc-4.3.2/libiberty/make-relative-prefix.c >--- gcc-4.3.2-clean/libiberty/make-relative-prefix.c 2009-01-21 22:35:14.000000000 +0000 >+++ gcc-4.3.2/libiberty/make-relative-prefix.c 2009-01-25 15:26:02.000000000 +0000 >@@ -57,6 +57,9 @@ > #ifdef HAVE_UNISTD_H > #include <unistd.h> > #endif >+#ifdef HAVE_SYS_STAT_H >+#include <sys/stat.h> >+#endif > > #include <string.h> > >@@ -254,6 +257,7 @@ > { > if (*endp == PATH_SEPARATOR || *endp == 0) > { >+ struct stat st; > if (endp == startp) > { > nstore[0] = '.'; >@@ -271,10 +275,11 @@ > else > nstore[endp - startp] = 0; > } >+ > strcat (nstore, progname); >- if (! access (nstore, X_OK) >+ if ((! stat(nstore, &st) && S_ISREG (st.st_mode) && ! access (nstore, X_OK)) > #ifdef HAVE_HOST_EXECUTABLE_SUFFIX >- || ! access (strcat (nstore, HOST_EXECUTABLE_SUFFIX), X_OK) >+ || (! stat (strcat (nstore, HOST_EXECUTABLE_SUFFIX)) && S_ISREG (st.st_mode) && ! access (nstore, X_OK)) > #endif > ) > {
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 38966
:
17181
|
17189
|
28023