This is the mail archive of the glibc-linux@ricardo.ecn.wfu.edu mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Broken basename()


On Tue, Jun 01, 1999 at 10:46:52AM -0400, Jean Pierre Belanger elucidated:
> Thank's for the info!
> 
> What's the rule about using libgen.h and string.h ?
> 
> Can I automatically replace all my libgen.h with string.h
> inside my application?
> 
> If not, how can I make the two includes coexist ?
> 
> Thanks,
> Jean-Pierre
> 


Probably not if you want to applications to be easily portable.  Something
that seems to be occurring even more of late is applications writers are
writing for Linux only, ignoring the rest of the Unix world.  At best it
is just laziness.  

If you are just stripping the path, you could just do something like:

progname = (tmpptr = strrchr(argv[0],'/')) ? tmpptr + 1 : argv[0];

--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Dale Harris  <rodmur@maybe.org>   GPG key: 372FBD57    http://www.maybe.org/
"I'd rather have this bottle in front of me, than a frontal lobotomy."

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]