Mail Archives: djgpp/1998/02/25/10:02:39
Dim Zegebart wrote:
>
> Hi,
> I just found a very interesting feature of _fixpath, look :
[...]
>
> Perhaps, this is a special feature of _fixedpath (perhaps, usefull for
> somebody) ...
> But, how I should allocate space for fixed_name exept declaring it as
> 'char fixed_name[MAXDIR]' ?
I think this is an (undocumented) feature. You should
_NEVER_ rely on _fixedpath returning the same length as
the string you feed in. IIRC, it internally calls
_truename(), and that one prepends the current working directory
if it is not there, so you get a fully qualified pathname.
Better use
char fixed_name = (char*) malloc(MAXNAME);
(I think MAXNAME is the maximum len including
drive and path, cross check that).
--
Ciao
Tom
*************************************************************
* Thomas Demmer *
* Lehrstuhl fuer Stroemungsmechanik *
* Ruhr-Uni-Bochum *
* Universitaetsstr. 150 *
* D-44780 Bochum *
* Tel: +49 234 700 6434 *
* Fax: +49 234 709 4162 *
* http://www.lstm.ruhr-uni-bochum.de/~demmer *
*************************************************************
- Raw text -