GCC Bugzilla – Attachment 17189 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 with conditional use of stat based on HAVE_SYS_STAT_H
libiberty.diff (text/plain), 1.15 KB, created by
Michael Lotz
on 2009-01-27 01:23:31 UTC
(
hide
)
Description:
Proposed fix with conditional use of stat based on HAVE_SYS_STAT_H
Filename:
MIME Type:
Creator:
Michael Lotz
Created:
2009-01-27 01:23:31 UTC
Size:
1.15 KB
patch
obsolete
>--- /Source2/source/gcc-haiku/gcc-4.3.3-clean/libiberty/make-relative-prefix.c 2009-01-25 15:45:38.000000000 +0000 >+++ /Source2/source/gcc-haiku/gcc-4.3.3/libiberty/make-relative-prefix.c 2009-01-27 02:15:34.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,9 @@ > { > if (*endp == PATH_SEPARATOR || *endp == 0) > { >+#ifdef HAVE_SYS_STAT_H >+ struct stat st; >+#endif > if (endp == startp) > { > nstore[0] = '.'; >@@ -271,10 +277,19 @@ > else > nstore[endp - startp] = 0; > } >+ > strcat (nstore, progname); >- if (! access (nstore, X_OK) >+ if (( >+#ifdef HAVE_SYS_STAT_H >+ ! stat(nstore, &st) && S_ISREG (st.st_mode) && >+#endif >+ ! access (nstore, X_OK)) > #ifdef HAVE_HOST_EXECUTABLE_SUFFIX >- || ! access (strcat (nstore, HOST_EXECUTABLE_SUFFIX), X_OK) >+ || (! access (strcat (nstore, HOST_EXECUTABLE_SUFFIX), X_OK) >+#ifdef HAVE_SYS_STAT_H >+ && ! stat (nstore) && S_ISREG (st.st_mode) >+#endif >+ ) > #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