Commit c2897436 by Jeffrey A Law Committed by Jeff Law

collect2.c (IS_DIR_SEPARATOR): Define.

        * collect2.c (IS_DIR_SEPARATOR): Define.
        (prefix_from_string): Use IS_DIR_SEPARATOR and DIR_SEPARATOR.

From-SVN: r30182
parent 7f6dae2a
...@@ -17,6 +17,9 @@ Mon Oct 25 23:10:45 1999 Andreas Schwab <schwab@suse.de> ...@@ -17,6 +17,9 @@ Mon Oct 25 23:10:45 1999 Andreas Schwab <schwab@suse.de>
Mon Oct 25 23:03:09 1999 Jeffrey A Law (law@cygnus.com) Mon Oct 25 23:03:09 1999 Jeffrey A Law (law@cygnus.com)
* collect2.c (IS_DIR_SEPARATOR): Define.
(prefix_from_string): Use IS_DIR_SEPARATOR and DIR_SEPARATOR.
* som.h (ASM_DECLARE_FUNCTION_NAME): Set PRIV_LEV for static * som.h (ASM_DECLARE_FUNCTION_NAME): Set PRIV_LEV for static
functions too. functions too.
......
...@@ -49,6 +49,17 @@ Boston, MA 02111-1307, USA. */ ...@@ -49,6 +49,17 @@ Boston, MA 02111-1307, USA. */
#include "obstack.h" #include "obstack.h"
#include "intl.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. */ /* Obstack allocation and deallocation routines. */
#define obstack_chunk_alloc xmalloc #define obstack_chunk_alloc xmalloc
#define obstack_chunk_free free #define obstack_chunk_free free
...@@ -810,9 +821,9 @@ prefix_from_string (p, pprefix) ...@@ -810,9 +821,9 @@ prefix_from_string (p, pprefix)
{ {
strcpy (nstore, "./"); 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; nstore[endp-startp+1] = 0;
} }
else else
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment