Subject: Re: What should stat("",&fs) return?
To: None <Todd.Miller@cs.colorado.edu>
From: Chris G Demetriou <Chris_G_Demetriou@UX2.SP.CS.CMU.EDU>
List: current-users
Date: 05/31/1996 00:54:42
> Actually, it seems likely that it was done to be more compatible
> with /bin/sh's treating "" as ".". That way, if you strtok() through
> $PATH you'll treat "" as "." like /bin/sh does, which does make some
> amount of sense :-)
strtok? strtok didn't show up (in libc) until '85. the "treat an
empty string as ." convention in the pathname resolution code dates to
before 1980.
It's likely that it was there from much earlier than that (somebody
with copy of the Lions book? i can't find mine right now 8-).
Anyway, back in '80, that little bit of code apparently looked
somewhat like:
path_pointer = (pointer to data copied in from wherever);
if (*path_pointer is '/') then
path_pointer++
start at root directory
else
start at current directory
endif
Indeed, the 'traditional BSD' behaviour may have actually been
traditional AT&T UNIX behaviour...
cgd