Path: utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!uunet!mcsun!hp4nl!fwi.uva.nl!kim!croes From: croes@fwi.uva.nl (Felix A. Croes) Newsgroups: comp.os.minix Subject: Re: 1.5.0 upgrade: REPORT + BUGS + PATCHES Message-ID: <363@fwi.uva.nl> Date: 11 Jan 90 10:04:20 GMT References: <1990Jan7.205429.5247@chinet.chi.il.us> Sender: news@fwi.uva.nl Reply-To: croes@fwi.uva.nl (Felix A. Croes) Organization: The Courts of Chaos Lines: 24 In article <1990Jan7.205429.5247@chinet.chi.il.us> bill@chinet.chi.il.us (Bill Mitchell) writes: > [stuff deleted] >PROBLEM: The ls command didn't work > >"ls file" worked, but "ls", "ls .", and "ls /" didnt. > >This is apparently due to some problem below readdir(), so dp->d_name >isn't returned as expected. Things got complicated pretty fast here. >Knowing nothing about POSIX stuff, I didn't feel qualified pursue it. >I did notice that /usr/include/dirent.h had struct dirent.d_name >declared as "char d_name[1]", which looked suspicious. ^^^^^^^*^ I don't know about POSIX, but it should be at least 14. It was 14 in Minix 1.3, since file names in directories are 14 bytes long. However, using 14 will cause problems with numerous incorrect programs which assume that file names in directories always terminate in \0 (ever tried 1.3 tar?). The comment says: /* name of file plus a 0 byte */ , so perhaps 15 should be used? Does any POSIX wizard know? -- Felix Croes (croes@fwi.uva.nl)