Message-ID: From: "Andris Pavenis" To: Andris Pavenis , Eli Zaretskii Date: Fri, 14 Aug 1998 21:10:16 +0300 MIME-Version: 1.0 Content-type: text/plain; charset=US-ASCII Content-transfer-encoding: 7BIT Subject: Re: -fxref bug? CC: Gerhard Gruber , djgpp AT delorie DOT com References: In-reply-to: Precedence: bulk Date sent: Thu, 13 Aug 1998 14:18:44 +0300 (IDT) From: Eli Zaretskii Subject: Re: -fxref bug? > > 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] == ':'))) > I think #define FILE_NAME_ABSOLUTE_P(NAME) \ (((NAME)[0] == '/') || ((NAME)[0] == '\\') || \ ((isalpha(NAME)[0]) && ((NAME)[1]==':'))) is even more better (we are excluding special symbols between 'Z' and 'a') Andris