instability in Berkeley versus AT&T releases (really index)
John Mashey
mash at mips.UUCP
Mon Jul 29 14:43:57 AEST 1985
Guy Harris writes (onto long sequence of articles):
> > > * Don't flame me if the index/strchr difference isn't an example of NIH --
> > > I haven't used V5 much...
>
> Furthermore, the index/strchr difference is probably not an example of NIH
> in the way the original poster thought. *Both* routines are products of
> AT&T - the routine was called "index" in V7 and "strchr" in System III. At
> what point it was renamed, I dunno. The S3 documentation comes with a
> description of changes between S3 and some unspecified earlier version of
> UNIX. One of the changes was that "strcpyn" was renamed "strncpy". This
> predates V7, since it was called "strncpy" there as well.
0) As usual, Guy has pretty good model of the history, minor details:
1) index->strchr happened in UNIX/TS 1.0 (in some sense, System I of the System
V sequence). My 1.0 manual reads November 78; as I recall, this particular
change happened fairly early in the packaging effort that was trying to
get Edition 7 (late, but not released), PWB/UNIX 1.2, and some USG G3
UNIX all back together.
2) strcpyn ->strncpy happened at the same time, early 78. The rename
was because some non-UNIX systems (GCOS, I think) took only the first
6 characters, so that strcpy and strcpyn conflicted, a clearly bad thing.
3) In general, it is unwise to EVER label something as NIH unless you know
for a fact that it is NIH. There are more weird reasons for things being
different in different UNIX versions than you would ever believe; only a few
of them are NIH; it is always best to ask why things are different.
--
-john mashey
UUCP: {decvax,ucbvax,ihnp4}!decwrl!mips!mash
DDD: 415-960-1200
USPS: MIPS Computer Systems, 1330 Charleston Rd, Mtn View, CA 94043
More information about the Comp.unix.wizards
mailing list