Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!seismo!sundc!pitstop!sun!gorodish!guy From: guy%gorodish@Sun.COM (Guy Harris) Newsgroups: comp.unix.wizards Subject: Re: /bin/test and stat(2) Message-ID: <30542@sun.uucp> Date: Fri, 9-Oct-87 20:25:05 EDT Article-I.D.: sun.30542 Posted: Fri Oct 9 20:25:05 1987 Date-Received: Sun, 11-Oct-87 17:37:51 EDT References: <9721@brl-adm.ARPA> Sender: news@sun.uucp Lines: 17 > 2) Programs like 'ls', 'cd', 'chmod', 'test', 'rmdir', etc.... > ^^^^ > have all been coded to rely on this default(this can be verified > by do something like 'ls ""' or 'chmod ""', etc). In my opinion, is > very bad programming practice. In my opinion, this is utter nonsense. There is no reason for all those programs to be coded to explicitly *check* for a null string as an argument; the mere fact that 'ls ""' does not cause an error hardly means that the program has been explicitly coded to rely on this. Does the fact that the "strcmp" routine does not check whether its arguments are NULL mean that "strcmp" was, say, explicitly coded to rely on the fact that in some C implementations a NULL string, when improperly treated as a string pointer, yields a null string? Guy Harris {ihnp4, decvax, seismo, decwrl, ...}!sun!guy guy@sun.com