Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/18/84; site drivax.UUCP Path: utzoo!linus!philabs!cmcl2!seismo!hao!hplabs!amdahl!drivax!alan From: alan@drivax.UUCP (Alan Fargusson) Newsgroups: net.unix-wizards,net.bugs.usg Subject: Re: ls(1) on System V Message-ID: <119@drivax.UUCP> Date: Wed, 3-Apr-85 01:09:40 EST Article-I.D.: drivax.119 Posted: Wed Apr 3 01:09:40 1985 Date-Received: Tue, 9-Apr-85 00:40:11 EST References: <176@mplvax.UUCP> Organization: Digital Research, Monterey, CA Lines: 30 Xref: linus net.unix-wizards:9882 net.bugs.usg:184 > ls(1) has two options to produce multi-column output, > -C for sorted down the columns > -x for sorted across the rows > > if *any* file in a directory has a full-length (14-char) name, > then these options fail, and a single-column output results. I thought I would try out 14 character names with ls on System V/iAPX286 and The result on the 286 was 2 column output, while the VAX produced 5 column output. In looking at the source I found that the directory structure is declared as follows: struct { short inode; char name[14]; } directory; Or something like that. The problem is that strlen(3) is called with the name as an argument. When the name is 14 characters long, strlen falls off the end of the name, and returns a large number. By dumb luck the VAX has a null after the name. The VME/10s around here do not have the version of ls with the -C and -x flags. I can't think of any way around this problem without fixing the source, since a null has to be added to the end of the name for strlen to work. -- Alan Fargusson. { ihnp4, sftig, amdahl, ucscc, ucbvax!unisoft }!drivax!alan