Article View: comp.os.msdos.programmer
Article #8013Re: LABEL/directory confusion - genuine bug in MSDOS 6.0 ?
From: Ralf Brown
Date: Mon, 28 Feb 1994 12:03
Date: Mon, 28 Feb 1994 12:03
28 lines
2553 bytes
2553 bytes
In article <2kq5g0$rq@marlin.ssnet.com>, panda@marlin.ssnet.com (Pamela Kane) wrote: }OK...Forget the few hours with DEBUG. A simple INT 21 intercept program }points up the bug. LABEL gets the current directory with INT 21 function }47, which does not give drive and root, only path. This string is fed }through the undocumented function 60 to get the fully resolved }drive:path. (This will account for a SUBST or ASSIGNED or JOINED }drive.) If there is a subdirectoy which has the same name as the }current directory, that name is reported back as the fully resolved path }and not the current directory. Try it yourself. Switch to the }subdirectory, and type TRUENAME "TEMP". If there is a TEMP in the }subdirectory the return is C:\TEMP\TEMP. As someone else has already pointed out, that is the correct behavior for TRUENAME, since you are asking it to resolve a path relative to the current directory. I haven't tried looking at LABEL, but I think the bug in LABEL is that it doesn't prepend a backslash to the current directory retrieved with INT 21/47. That function does not include the initial backslash indicating the root directory (i.e. if you are in the root directory, it returns an empty string, if in C:\FOO it returns FOO, etc.). Naturally, if you then do a TRUENAME on the unmodified returned string, it will be taken as a relative filename and will go deeper in the directory tree if there is a matching path from the current subdirectory. -- Internet: RALF+@CS.CMU.EDU | The University would disclaim this if it knew... FIDO: Ralf Brown 1:129/26.1 | "Life is great--I wouldn't know what I'd do BIT: RALF%CS.CMU.EDU@MITVMA | without it." -- Alan Alda
Technical Details
Message-ID:
<2d71eba1@ralf>Path:
arc1-ca.pugleaf.net!gmd.de!xlink.net!howland.reston.ans.net!agate!library.ucla.edu!news.mic.ucla.edu!nntp.club.cc.cmu.edu!honeydew.srv.cs.cmu.edu!ralfShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 10f6aa,adccdfccfe3eda50 X-Google-Attributes: gid10f6aa,public X-Google-Thread: 10d683,adccdfccfe3eda50 X-Google-Attributes: gid10d683,public X-Google-ArrivalTime: 1994-02-28 04:03:29 PST Newsgroups: comp.os.msdos.programmer,aus.computers.ibm-pc Path: arc1-ca.pugleaf.net!gmd.de!xlink.net!howland.reston.ans.net!agate!library.ucla.edu!news.mic.ucla.edu!nntp.club.cc.cmu.edu!honeydew.srv.cs.cmu.edu!ralf From: Ralf Brown <ralf@telerama.lm.com> Subject: Re: LABEL/directory confusion - genuine bug in MSDOS 6.0 ? In-Reply-To: <2kq5g0$rq@marlin.ssnet.com> Message-ID: <2d71eba1@ralf> Originator: ralf@B.GP.CS.CMU.EDU Sender: news@cs.cmu.edu (Usenet News System) Nntp-Posting-Host: b.gp.cs.cmu.edu Organization: Just me and my PC.... Date: Mon, 28 Feb 1994 12:03:29 GMT Lines: 28