[Coco] Microware C question/problem

Bob Devries bdevries at gil.com.au
Sat Dec 31 00:51:30 EST 2005


W.R.T. basename() here's an option:

#ifndef HAVE_BASENAME
#define basename(s) (strrchr((s), '/') == NULL ? (s) : strrchr((s), '/') + 
1)
#endif
http://sprg.ssl.berkeley.edu/~fastops/ITOS/portable/basename$28$29.html--
Regards, Bob Devries, Dalby, Queensland, Australia

Isaiah 50:4 The sovereign Lord has given me
the capacity to be his spokesman,
so that I know how to help the weary.

website: http://www.home.gil.com.au/~bdevasl
my blog: http://bdevries.invigorated.org/

----- Original Message ----- 
From: "Robert Gault" <robert.gault at worldnet.att.net>
To: "CoCoList for Color Computer Enthusiasts" <coco at maltedmedia.com>
Sent: Saturday, December 31, 2005 3:37 PM
Subject: Re: [Coco] Microware C question/problem


> I'm glad its not just me. :)   That use of strrchr was something I found 
> on the Internet with reference to a replacement for basename() but I have 
> lost the url. It was so short, I thought I'd try it to find out if it 
> would work, but then had compilation problems.
>
> Actually I'd expect bad C code to give incorrect answers or syntax error 
> messages, not compile to illegal assembly code. Well, live and learn.
>
> Bob Devries wrote:
>> besides that, the code output for "/"||"\\" is:
>> ldd #1
>> very odd indeed.
>>
>> -- 
>
> -- 
> Coco mailing list
> Coco at maltedmedia.com
> http://five.pairlist.net/mailman/listinfo/coco
>
>
> -- 
> No virus found in this incoming message.
> Checked by AVG Free Edition.
> Version: 7.1.371 / Virus Database: 267.14.9/217 - Release Date: 30/12/2005
>
> 




More information about the Coco mailing list