Path: utzoo!utgpu!watmath!iuvax!mailrus!tut.cis.ohio-state.edu!attctc!jls From: jls@attctc.Dallas.TX.US (Jerome Schneider) Newsgroups: comp.lang.c Subject: Contents of argv[0] Keywords: start-up code, argv specifications Message-ID: <9002@attctc.Dallas.TX.US> Date: 15 Aug 89 03:38:08 GMT Organization: Aspen Technology Group, Ft. Collins, CO Lines: 14 Both K&R and H&S document the argv[0] string as "the name of the program". This definition doesn't seem to mandate (or exclude) the presence of a path component in the string. A few *nix programs use rindex() or strrchr() to scan for '/', implying (to me at least) that _some_ implementations consider "name" to include such information. The DOS Microsoft C (5.x) startup code constructs the full path name for argv[0] (in upper case, no less!). Are there any (proposed) standards for argv[0] syntax? If not, should a _portable_ application always rindex() argv[0] for a path delimiter before optionally (under DOS and OS half) converting the name to_lower()? -- Jerome Schneider UUCP: killer.DALLAS.TX.US!jls (guest account) Aspen Technology Group Ft. Collins, CO Voice: (303) 484-8466