🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: comp.os.msdos.programmer
2 messages
2 total messages Started by Ralf Brown Mon, 28 Feb 1994 12:03
Re: LABEL/directory confusion - genuine bug in MSDOS 6.0 ?
#8013
Author: Ralf Brown
Date: Mon, 28 Feb 1994 12:03
28 lines
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
Re: LABEL/directory confusion - genuine bug in MSDOS 6.0 ?
#8019
Author: Ian Staples
Date: Fri, 04 Mar 1994 07:48
26 lines
2021 bytes
Ralf Brown <ralf@telerama.lm.com> writes:
>... 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.

Presumably that would also explain the behaviour mentioned by someone else
that it will go "double deep", or even further?

That is, with the structure c:\x\x\x\x\x\x\x\x, if you give the LABEL
command from c:\x you end up in c:\x\x; if from c:\x\x you go to c:\x\x\x\x
and so on (up to 3 or 4 levels as I recall he said).  [Just tried it - it
will do the same up to 5 levels at least, if your directory structure is
deep enough.]

Cheers, Ian S.
-- 

Ian Staples                        E-mail : ianst@dpi.qld.gov.au
c/- P.O. Box 1054 MAREEBA          Phone  : +61 (0)70 921 555 Home 924 847
Queensland Australia 4880            Fax  : +61 (0)70 923 593   "   "   "
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads