Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!linus!security!genrad!decvax!harpo!seismo!hao!hplabs!sri-unix!gwyn@brl-vld From: gwyn%brl-vld@sri-unix.UUCP Newsgroups: net.unix Subject: Re: argc[argv] and Berknet Message-ID: <14434@sri-arpa.UUCP> Date: Thu, 8-Dec-83 11:44:42 EST Article-I.D.: sri-arpa.14434 Posted: Thu Dec 8 11:44:42 1983 Date-Received: Tue, 13-Dec-83 01:30:34 EST Lines: 9 From: Doug Gwyn (VLD/VMB) There is no mystery about argc[argv] = 0; pre-7th Edition PDP-11 UNIX exec marked the end of the arguments with a 16-bit constant -1 and newer UNIXes mark the end of the argument list with a (char *)0. The run-time start-off looks for this terminator to determine argc to pass to main(). The above code merely patches a 6th Edition image so that *argv++ can be easily used to pick up arguments and test for the last argument. (Not recommended.)