X-Authentication-Warning: delorie.com: mail set sender to djgpp-bounces using -f From: RayeR Newsgroups: comp.os.msdos.djgpp Subject: Re: argv[0] Date: Tue, 6 Dec 2011 08:53:34 -0800 (PST) Organization: http://groups.google.com Lines: 22 Message-ID: <22d7b570-3a15-4703-878d-0213a169427b@y7g2000vbe.googlegroups.com> References: <16b04d29-8317-4c7f-929c-1a22a328fa32 AT p9g2000vbb DOT googlegroups DOT com> <6719f201-2317-420d-bb38-3be66c90140b AT q9g2000yqe DOT googlegroups DOT com> <5059ad16-7787-49ef-8fb3-d9c21919a65b AT d10g2000vbf DOT googlegroups DOT com> <20af6883-aa05-4549-b820-ca0f7c80708d AT ca1g2000vbb DOT googlegroups DOT com> <21af264d-bd9d-40e8-ad61-e16e2836ad52 AT 20g2000yqa DOT googlegroups DOT com> NNTP-Posting-Host: 90.181.199.10 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 X-Trace: posting.google.com 1323190414 31330 127.0.0.1 (6 Dec 2011 16:53:34 GMT) X-Complaints-To: groups-abuse AT google DOT com NNTP-Posting-Date: Tue, 6 Dec 2011 16:53:34 +0000 (UTC) Complaints-To: groups-abuse AT google DOT com Injection-Info: y7g2000vbe.googlegroups.com; posting-host=90.181.199.10; posting-account=Q0wMHAoAAADjYrghh94FTf6YnbpTqZgp User-Agent: G2/1.0 X-Google-Web-Client: true X-Google-Header-Order: HUALESNKRC X-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1.19) Gecko/20110420 SeaMonkey/2.0.14,gzip(gfe) Bytes: 2573 To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com > The absolute path name in the environment is available in MS-DOS, > FreeDOS and a XP DOS box, but probably not on all DOS clones. So this may be + for simpler solution with argv :) > I called my program MCB - therefore I did not see this problem. DOS > allows for 8 bytes in the MCB and if the program name is shorter it > will add a NUL, not so if the program name is 8 bytes already. > Therefore my code will print up to the next NUL after the program > name. Aha, I named the file as mcbtrace.c and mcbtrace.exe I didn't studied the code much so I don't know about this side effect. > I see no drive letter in the path - why does it start with MARTIN? Are > you running from a network drive? What is the output of argv[0] in > this case? No, it's local drive K: so right path argv[0]="K:/MARTIN/C/EXAMPLES/ MCBTRACE.EXE" Martin