cvs.gedasymbols.org/archives/browse.cgi   search  
Mail Archives: djgpp/1998/08/13/07:21:28

Date: Thu, 13 Aug 1998 14:18:44 +0300 (IDT)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
To: Andris Pavenis <pavenis AT lanet DOT lv>
cc: Gerhard Gruber <sparhawk AT eunet DOT at>, djgpp AT delorie DOT com
Subject: Re: -fxref bug?
In-Reply-To: <B0000039165@stargate.astr.lu.lv>
Message-ID: <Pine.SUN.3.91.980813141123.4803H-100000@is>
MIME-Version: 1.0

On Thu, 13 Aug 1998, Andris Pavenis wrote:

> + #ifdef __DJGPP__
> + #define FILE_NAME_ABSOLUTE_P(NAME) \
> + 	((NAME[0] == '/') || \
> + 	(isascii(NAME[0]) && NAME[1]==':' && \
> + 	 (NAME[2]=='/' || NAME[2]=='\\')))
> + #endif

Thanks.

However, this has a few drawbacks: a drive letter doesn't have to be 
isascii and a name such as d:foo should also be treated as absolute.  It 
also doesn't support backslashes.

So I would suggest the following:

  #define FILE_NAME_ABSOLUTE_P(NAME) \
      (((NAME)[0] == '/') || ((NAME)[0] == '\\') || \
       (((NAME)[0] >= 'A') && ((NAME)[0] <= 'z') && ((NAME)[1] == ':')))

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019