diff options
author | law <law@138bc75d-0d04-0410-961f-82ee72b054a4> | 1999-10-26 06:03:19 +0000 |
---|---|---|
committer | law <law@138bc75d-0d04-0410-961f-82ee72b054a4> | 1999-10-26 06:03:19 +0000 |
commit | 01a882891d5ab88bf8f708854de2e5c87b394cce (patch) | |
tree | de83ea9e77806bf2fdcf62fdd111b0bc4c866530 /gcc/collect2.c | |
parent | eb39bd27036702e04c921c8769152dfe26174349 (diff) | |
download | gcc-01a882891d5ab88bf8f708854de2e5c87b394cce.tar.gz |
* collect2.c (IS_DIR_SEPARATOR): Define.
(prefix_from_string): Use IS_DIR_SEPARATOR and DIR_SEPARATOR.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@30182 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/collect2.c')
-rw-r--r-- | gcc/collect2.c | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/gcc/collect2.c b/gcc/collect2.c index 64101bf6722..9138bcd6583 100644 --- a/gcc/collect2.c +++ b/gcc/collect2.c @@ -49,6 +49,17 @@ Boston, MA 02111-1307, USA. */ #include "obstack.h" #include "intl.h" +#ifndef DIR_SEPARATOR +# define IS_DIR_SEPARATOR(ch) ((ch) == '/') +#else /* DIR_SEPARATOR */ +# ifndef DIR_SEPARATOR_2 +# define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR) +# else /* DIR_SEPARATOR && DIR_SEPARATOR_2 */ +# define IS_DIR_SEPARATOR(ch) \ + (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2)) +# endif /* DIR_SEPARATOR && DIR_SEPARATOR_2 */ +#endif /* DIR_SEPARATOR */ + /* Obstack allocation and deallocation routines. */ #define obstack_chunk_alloc xmalloc #define obstack_chunk_free free @@ -810,9 +821,9 @@ prefix_from_string (p, pprefix) { strcpy (nstore, "./"); } - else if (endp[-1] != '/') + else if (! IS_DIR_SEPARATOR (endp[-1])) { - nstore[endp-startp] = '/'; + nstore[endp-startp] = DIR_SEPARATOR; nstore[endp-startp+1] = 0; } else |