Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!dgp.toronto.edu!flaps
From: flaps@dgp.toronto.edu (Alan J Rosenthal)
Newsgroups: comp.lang.c
Subject: Re: Contents of argv[0]
Message-ID: <1989Aug18.130710.13954@jarvis.csri.toronto.edu>
Date: 18 Aug 89 17:07:11 GMT
References: <9002@attctc.Dallas.TX.US> <1681@crdgw1.crd.ge.com> <1705@crdgw1.crd.ge.com> <5722@ficc.uu.net>
Lines: 19

peter@ficc.uu.net (Peter da Silva) writes:
>	parse_file(name, buffer)
>	char *name;
>	struct filename *buffer;
>
>		Parses the elements of name into the buffer. name will
>		be modified as necessary to null-terminate the elements
>		of buffer. Returns the actual number of elements found
>		in the name... missing or meaningless elements will contain
>		null pointers.

Problem is, there aren't always characters available in the right places in
name to be overwritten with zeroes to terminate the various strings.  In unix,
consider the file name "/file".  The directory is "/", the file name is "file",
but there's nowhere to put the zero to terminate the string "/".  A directory
name of "" is not acceptable; it will work under some circumstances (namely,
when a slash and a file name is appended) but not in all.

ajr