Hi!
23-Июн-2006 10:00 [EMAIL PROTECTED] (Blair Campbell) wrote to
[email protected]:
>> BC> + return( ( _CFLAG || _AX == 0x7100 ) ?
>> BC> + strcpy( shortfilename, longfilename ) : shortfilename );
>> May you explain, why you copy longfilname to shortfilename? Especially,
>> there is latent bug, because shortfilename is local buffer, which will be
>> overwritten by subsequent calls to getshortfilename(). May be, this is your
>> way to eliminate error message (about returning const string as non-const)?
>> But why you not add const modifier for return type?
BC> There is nothing wrong with it being overwritten by subsequent calls,
BC> because it is only used to help clib functions see long filenames.
First, main question is "why to slowdown code by using strcpy()".
Second, about latent bug: such behavior (with side effects) should be
explicitly documented. At least, there should be comment before function,
which says, that "result is placed in internal static buffer, which may be
overwritten by each subsequent call". This should minimize possible mistakes
in future, when someone tries to remember pointer to returned string for
later usage.
>> BC> + access |= O_CREAT;
>> First: `access' is already contains O_CREAT bit set, so |= above is
>> redundant. Or there is bug and this bit should be cleared?
BC> Please read newer revisions before picking at old ones.
I read letters (more or less) sequentially. :)
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Freedos-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/freedos-devel